* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  margin: 0; background: #f7f8fa; color: #222;
}
header {
  background: #1d1f23; color: #fff; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
.muted { color: #888; font-weight: 400; }
.status { font-size: 12px; color: #aaa; }
.status .ok { color: #6bd; }
.status .ng { color: #f88; }

main { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
.card {
  background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 18px 22px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 8px; font-size: 16px; }
.card h2 small { color: #888; font-weight: 400; font-size: 12px; margin-left: 6px; }
.hint { color: #666; font-size: 13px; margin: 0 0 12px; line-height: 1.6; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  border: 1px solid #eee; border-radius: 6px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.row .meta { font-size: 12px; color: #888; }
.row .actions { display: flex; gap: 6px; }
.row.empty { color: #888; text-align: center; padding: 20px; border-style: dashed; }

button {
  background: #06c; color: #fff; border: 0; border-radius: 4px;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
}
button:hover { background: #05b; }
button.secondary { background: #ddd; color: #333; }
button.secondary:hover { background: #ccc; }
button.danger { background: #c33; }
button.danger:hover { background: #b22; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.form-toggle { margin-top: 12px; }
.form-toggle summary { cursor: pointer; color: #06c; font-size: 13px; }
.form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.form label small { font-weight: 400; color: #888; }
.form input { padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; }
.form button { align-self: flex-start; }

.post-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.post-controls select, .post-controls textarea {
  padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; font-family: inherit;
}
.post-actions { display: flex; align-items: center; justify-content: space-between; }

.badge {
  font-size: 11px; padding: 2px 6px; border-radius: 3px; background: #eee; color: #666;
  margin-left: 6px;
}
.badge.draft { background: #fef3c7; color: #92400e; }
.badge.approved { background: #dbeafe; color: #1e40af; }
.badge.published { background: #d1fae5; color: #065f46; }
.badge.deleted { background: #f3f4f6; color: #6b7280; }
.badge.failed { background: #fee2e2; color: #991b1b; }
.badge.active { background: #d1fae5; color: #065f46; }
.badge.paused { background: #fef3c7; color: #92400e; }
.badge.revoked { background: #fee2e2; color: #991b1b; }
.badge.token-yes { background: #d1fae5; color: #065f46; }
.badge.token-no { background: #fee2e2; color: #991b1b; }

.post-text { font-size: 13px; color: #333; max-width: 540px; overflow-wrap: anywhere; }
.audit-row { font-size: 12px; }
.audit-row .action { font-weight: 600; color: #06c; }
.audit-row .meta-json {
  font-family: ui-monospace, monospace; font-size: 11px; color: #888;
  background: #f7f8fa; padding: 4px 8px; border-radius: 3px; margin-top: 4px;
  white-space: pre-wrap; word-break: break-all;
}

.badge.scheduled { background: #ede9fe; color: #5b21b6; }
.badge.media { background: #fef3c7; color: #92400e; }

.post-row {
  display: flex; flex-direction: column; gap: 10px;
  background: #f7f8fa; padding: 10px 12px; border-radius: 6px;
}
.post-row label { display: flex; flex-direction: column; font-size: 12px; gap: 4px; }
.post-row label small { color: #888; }
.post-row input, .post-row textarea {
  padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; font-family: inherit;
}
.post-row textarea { font-family: ui-monospace, monospace; }
.post-row button { align-self: flex-start; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal.hidden { display: none; }
.modal-body {
  background: #fff; border-radius: 8px; padding: 16px 20px;
  max-width: 880px; width: 92%; max-height: 80vh; overflow-y: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.picker-card {
  border: 2px solid #eee; border-radius: 6px; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .1s;
}
.picker-card:hover { border-color: #06c; }
.picker-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.picker-meta { padding: 6px 8px; font-size: 11px; color: #555; word-break: break-all; }
.picker-meta small { color: #888; }

.checkbox-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.checkbox-row input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.checkbox-row span { display: flex; flex-direction: column; gap: 2px; }
.checkbox-row small { color: #888; font-size: 11px; }
.badge.adult { background: #fce4ec; color: #ad1457; }
