/* Layout: one column, three numbered steps, then the scheduled posts. Optional things are folded away. */
:root {
  --cream: #EDE9E0; --forest: #2F4A41; --sage: #5F7269; --lavender: #A190B2;
  --bg: #FBF9F2; --surface: #FFFFFF; --fg: #24302B; --muted: #5F6B64; --line: #D6D3C8; --accent: #2F4A41; --accent-fg: #FFFFFF;
  --chip: #EDE9E0; --soft: #E9DFEF; --ok-bg: #E4EEE7; --ok-fg: #1F4A33; --warn-bg: #F6EEDC; --warn-fg: #6B4E12; --bad-bg: #F8E1DE; --bad-fg: #7A231A;
  --serif: Georgia, "Times New Roman", serif; --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18211D; --surface: #212C27; --fg: #EDE9E0; --muted: #A7B1AA; --line: #35433C; --accent: #B9C9BE; --accent-fg: #18211D;
    --chip: #2A3631; --soft: #3A3346; --ok-bg: #203A2C; --ok-fg: #CFE8D8; --warn-bg: #3A3220; --warn-fg: #F1D9A6; --bad-bg: #42221E; --bad-fg: #F4C9C2; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.5; padding: 20px max(16px, env(safe-area-inset-right)) 56px max(16px, env(safe-area-inset-left)); }
.wrap { max-width: 1040px; margin: 0 auto; display: grid; gap: 22px; }
main { display: grid; gap: 22px; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.brandmark { height: 34px; width: auto; display: block; }
.who { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--fg); font: 600 14px var(--sans); text-decoration: underline; cursor: pointer; }
.banner { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin: 0; }
.step, .scheduled { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; display: grid; gap: 16px; }
.step-title { display: flex; align-items: baseline; gap: 12px; }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font: 700 15px var(--sans); transform: translateY(-3px); }
h2 { font: 400 26px/1.2 var(--serif); margin: 0; text-wrap: balance; }
h3 { font: 700 13px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.step.locked { opacity: .55; }
.step.locked .body { display: none; }
.body, #chooser { display: grid; gap: 16px; }
.drop { border: 2px dashed var(--sage); border-radius: 10px; padding: 28px 16px; text-align: center; cursor: pointer; background: var(--bg); display: grid; gap: 6px; justify-items: center; }
.drop.over { background: var(--soft); }
.drop strong { font-size: 19px; }
.drop span { color: var(--muted); font-size: 14px; }
.lib-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.tile { position: relative; border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--chip); cursor: pointer; overflow: hidden; display: grid; text-align: left; font: inherit; color: inherit; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--line); }
.tile span { font-size: 12.5px; padding: 6px 8px; color: var(--muted); }
.tile:hover, .tile:focus-visible { border-color: var(--sage); }
.tile .badge { position: absolute; top: 6px; left: 6px; background: var(--forest); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.tile.removing { border-color: #B3412F; }
.tile .x { position: absolute; top: 6px; right: 6px; background: #B3412F; color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.picked { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--chip); }
.topic { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--chip); color: var(--fg); border-radius: 999px; padding: 9px 15px; font: 600 14px var(--sans); cursor: pointer; min-height: 40px; }
.chips.small .chip { padding: 6px 12px; min-height: 36px; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 700px) { .posts { grid-template-columns: minmax(0, 1fr); } }
.post { display: grid; gap: 8px; min-width: 0; }
.post-label { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
/* On touchscreens the page scrolls over the previews unless "Move photo" is on. */
canvas { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(47,74,65,.12); background: var(--cream); touch-action: pan-y pinch-zoom; }
@media (hover: hover) and (pointer: fine) { canvas { cursor: grab; } canvas:active { cursor: grabbing; } }
.moving canvas { touch-action: none; cursor: grab; outline: 3px solid var(--lavender); outline-offset: 3px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { font: 600 15px var(--sans); border-radius: 8px; padding: 11px 18px; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); min-height: 44px; display: inline-flex; align-items: center; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.big { font-size: 18px; padding: 14px 28px; min-height: 54px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--bad-bg); color: var(--bad-fg); border-color: currentColor; }
.zoom { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); flex: 1 1 200px; }
.zoom input { flex: 1; accent-color: var(--sage); }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
details { border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.edit { display: grid; gap: 12px; margin-top: 12px; }
.note { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.note .hint { font-weight: 400; }
.edit label, .when label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=date], input[type=time], textarea { width: 100%; font: 15px/1.45 var(--sans); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
textarea { resize: vertical; min-height: 200px; }
.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .caps { grid-template-columns: minmax(0, 1fr); } }
.when { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.when input { width: auto; }
.manual-tools { margin-top: 12px; }
.notice { border-radius: 10px; padding: 14px 16px; font-size: 15px; }
.notice.ok { background: var(--ok-bg); color: var(--ok-fg); }
.notice.warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice.bad { background: var(--bad-bg); color: var(--bad-fg); }
.sched-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.sched > li { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.sched time { font-weight: 700; font-variant-numeric: tabular-nums; }
.sched .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .sched .pair { grid-template-columns: minmax(0, 1fr); } }
.sp { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; }
.sp img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--chip); }
.sp p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; margin-left: 6px; background: var(--chip); }
.pill.scheduled { background: var(--ok-bg); color: var(--ok-fg); }
.pill.draft { background: var(--warn-bg); color: var(--warn-fg); }
.pill.failed { background: var(--bad-bg); color: var(--bad-fg); }
:focus-visible { outline: 3px solid var(--lavender); outline-offset: 2px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--forest); color: #fff; padding: 11px 18px; border-radius: 8px; font-weight: 600; font-size: 15px; z-index: 5; }
