* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f2ee;
  color: #24231f;
  font-family: "Yu Gothic", "YuGothic", "Hiragino Sans", Meiryo, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: #fffdf8;
  border-bottom: 1px solid #d8d2c8;
}

.eyebrow {
  margin: 0 0 4px;
  color: #a5533d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 16px;
  margin-bottom: 14px;
}

button {
  border: 1px solid #24231f;
  background: #24231f;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

button:hover {
  background: #45413a;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  padding: 22px;
}

.sidebar {
  position: sticky;
  top: 92px;
  height: calc(100vh - 114px);
  overflow: auto;
}

.panel,
.script-card {
  background: #fffdf8;
  border: 1px solid #d8d2c8;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(52, 47, 40, .07);
}

.panel {
  padding: 16px;
  margin-bottom: 16px;
}

.script-list {
  display: grid;
  gap: 18px;
}

.script-card {
  padding: 18px;
}

.card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid #e5ded4;
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.title-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #24231f;
  font-size: 24px;
  font-weight: 900;
  padding: 4px 0;
}

.title-input:focus,
textarea:focus,
input:focus {
  outline: 2px solid rgba(48, 105, 132, .28);
  outline-offset: 2px;
}

.meta-line {
  color: #786d64;
  font-size: 13px;
  font-weight: 800;
}

.approval {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #a5533d;
  font-weight: 900;
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 360px;
  gap: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #575148;
  font-size: 13px;
  font-weight: 900;
}

textarea,
input[type="datetime-local"],
input[type="number"] {
  width: 100%;
  border: 1px solid #d8d2c8;
  border-radius: 6px;
  background: #fff;
  color: #24231f;
  font: inherit;
  font-weight: 700;
  padding: 10px;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

.slides {
  display: grid;
  gap: 10px;
}

.slide-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: start;
}

.slide-no {
  padding-top: 11px;
  color: #a5533d;
  font-weight: 900;
  text-align: right;
}

.slide-row button,
.add-slide {
  background: #fff;
  color: #24231f;
}

.field-row {
  margin: 14px 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.generate-images {
  background: #2f745f;
  border-color: #2f745f;
}

.preview-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid #d8d2c8;
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: #24231f;
  font-weight: 900;
  text-decoration: none;
}

.preview-link:not([href]) {
  display: none;
}

.dry-run {
  background: #3f6575;
  border-color: #3f6575;
}

.publish {
  background: #a5533d;
  border-color: #a5533d;
}

.log {
  min-height: 42px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  background: #24231f;
  color: #f9f2e9;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
}

.schedule {
  display: grid;
  gap: 10px;
}

.schedule-item {
  display: block;
  width: 100%;
  border-left: 4px solid #d9a27e;
  background: #fff;
  color: #24231f;
  padding: 10px;
  border-radius: 4px;
  text-align: left;
  box-shadow: none;
}

.schedule-item.approved {
  border-color: #3b7f69;
}

.schedule-title {
  display: block;
  font-weight: 900;
  margin-bottom: 4px;
}

.schedule-date {
  display: block;
  color: #786d64;
  font-size: 12px;
  font-weight: 800;
}

.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

@media (max-width: 980px) {
  .layout,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}
