:root {
  color-scheme: light;
  --bg: #eef4fb;
  --panel: #ffffff;
  --text: #142033;
  --muted: #627083;
  --line: #d8e2ef;
  --blue: #0f5bd7;
  --blue-dark: #0b45a6;
  --soft: #f7faff;
  --button-shadow: 0 3px 0 rgba(20, 32, 51, 0.18), 0 10px 18px rgba(20, 32, 51, 0.08);
  --button-shadow-active: 0 1px 0 rgba(20, 32, 51, 0.2), 0 4px 10px rgba(20, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 42px);
  background: linear-gradient(135deg, #ffffff 0%, #e9f2ff 100%);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--blue);
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 40px);
}

h2 {
  font-size: 20px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 42px);
}

.panel,
.previewPanel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(20, 32, 51, 0.08);
}

.editor,
.saved {
  padding: 18px;
}

.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.row label {
  grid-template-rows: 21px 46px 18px;
  min-height: 96px;
  align-content: start;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

small {
  color: var(--muted);
  font-weight: 400;
  min-height: 18px;
  line-height: 18px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  color: var(--text);
  font: 16px Calibri, "Segoe UI", Arial, sans-serif;
  padding: 11px 12px;
  outline: none;
}

input[type="text"],
input[type="file"] {
  min-height: 46px;
}

.bibleRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.bibleRow button {
  min-height: 44px;
  margin-bottom: 14px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(15, 91, 215, 0.12);
}

.actionGroups,
.actionGroup,
.savedHeader,
.savedActions,
.previewHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.actionGroups {
  justify-content: flex-start;
  align-items: stretch;
  margin-top: 2px;
}

.actionGroup {
  justify-content: flex-start;
  align-content: flex-start;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 250, 255, 0.74);
}

.templateActions {
  margin-left: auto;
}

button {
  border: 1px solid #b8c6d8;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #edf4fc 100%);
  color: var(--text);
  font: 700 15px Calibri, "Segoe UI", Arial, sans-serif;
  padding: 10px 17px;
  cursor: pointer;
  min-height: 42px;
  box-shadow: var(--button-shadow);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease, border-color 0.12s ease;
  user-select: none;
  touch-action: manipulation;
}

button:hover {
  background: linear-gradient(180deg, #f8fbff 0%, #dfeeff 100%);
  border-color: #8faed2;
}

button:active {
  transform: translateY(2px);
  box-shadow: var(--button-shadow-active);
}

button:focus-visible {
  outline: 3px solid rgba(15, 91, 215, 0.28);
  outline-offset: 2px;
}

button.primary {
  background: linear-gradient(180deg, #1b6df0 0%, var(--blue-dark) 100%);
  border-color: var(--blue-dark);
  color: #ffffff;
}

button.primary:hover {
  background: linear-gradient(180deg, #0f5bd7 0%, #08377f 100%);
}

button.ghost {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  color: #314156;
}

.suggestionList {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
}

.suggestionList:empty {
  display: none;
}

.suggestionList button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 14px;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(20, 32, 51, 0.14);
}

.hidden {
  display: none;
}

.status {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.postList {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  max-height: 520px;
  overflow: auto;
}

.postItem {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.postItem strong {
  color: var(--text);
}

.postItem span {
  color: var(--muted);
}

.postItem div {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.previewPanel {
  margin: 0 clamp(16px, 4vw, 42px) 32px;
  padding: 16px;
}

.previewStrip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 14px 0 6px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.previewItem {
  width: min(72vw, 310px);
  flex: 0 0 auto;
  margin: 0;
  scroll-snap-align: start;
}

.previewItem figcaption {
  color: var(--muted);
  font-weight: 700;
  padding-top: 7px;
  text-align: center;
}

.previewImage {
  display: block;
  width: 100%;
  border-left: 1px solid rgba(20, 32, 51, 0.12);
  border-right: 1px solid rgba(20, 32, 51, 0.12);
}

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

  .bibleRow button {
    margin-bottom: 0;
  }
}
