/* Selling Image palette (sellingimage.com): periwinkle-indigo #5C5EDC, lavender #AFB0DB, white, black; font Lato */
:root {
  --page: #f6f6fb; --surface: #ffffff; --subtle: #f0f0f7; --line: #e6e6f0; --line-input: #d9d9e6;
  --ink: #17171c; --muted: #6c6c7a; --brand: #5c5edc; --brand-dark: #4547b8; --brand-tint: #eeeefb;
  --lavender: #afb0db; --lavender-soft: #d8d9f0;
  --ok: #4b8b5b; --ok-tint: #edf3ee; --warn: #c89a3a; --warn-tint: #f7f0df; --alert: #b5462f; --alert-tint: #f7e9e6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink);
  font: 16px/1.45 Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.env-banner { text-align: center; font-size: .85rem; padding: 6px 16px; background: var(--warn-tint); color: #6b5118; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; color: var(--brand); text-decoration: none; }
.brand img { border-radius: 6px; flex: none; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: 999px; }
.topbar nav a.active { background: var(--brand-tint); color: var(--brand); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 380px; margin: 32px auto; }
label { display: block; margin: 12px 0; font-weight: 600; font-size: .95rem; }
input:not([type=checkbox]), textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit;
  font-weight: 400; border: 1px solid var(--line-input); border-radius: 10px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
button, .button { font: inherit; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-input);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button:disabled { opacity: .35; cursor: default; }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); width: 100%; margin-top: 8px; }
button.primary:active { background: var(--brand-dark); }
button.danger { color: var(--alert); border-color: #e7c4c4; }
.muted { color: var(--muted); } .small { font-size: .85rem; font-weight: 400; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.flash-ok { background: var(--ok-tint); color: #2f5e3a; }
.flash-error { background: var(--alert-tint); color: var(--alert); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-between h2 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); }
.chip-default { background: var(--brand-tint); color: var(--brand); border-color: var(--lavender-soft); }
.style-list, .staff-list, .rules { padding: 0; margin: 12px 0 0; list-style: none; }
.style-list li, .staff-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.style-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.style-name { font-weight: 600; text-decoration: none; }
.style-actions { display: flex; gap: 6px; }
.style-actions button { padding: 6px 12px; }
.rules li { padding: 8px 0 8px 22px; position: relative; border-top: 1px solid var(--line); }
.rules li::before { content: "🔒"; position: absolute; left: 0; font-size: .8rem; top: 10px; }
.pill { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); }
details { width: 100%; } summary { cursor: pointer; color: var(--brand); margin-top: 4px; }
details form { margin-top: 8px; }
.danger-zone { border-color: #e7c4c4; }
/* capture + review */
.photo-pick { display: block; border: 2px dashed var(--lavender); border-radius: 14px; padding: 16px; text-align: center; cursor: pointer; background: var(--brand-tint); }
.photo-pick input { width: 100%; font-weight: 400; }
.photo-pick img, .photo-pick video { display: block; max-width: 100%; max-height: 320px; margin: 12px auto 0; border-radius: 10px; }
.photo-pick [hidden] { display: none; }
.photo-pick-label { display: block; margin-top: 8px; color: var(--brand); }
.chips.pick { margin-top: 4px; }
.chip-radio { margin: 0; font-weight: 400; }
.chip-radio input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.chip-radio span { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); cursor: pointer; }
.chip-radio input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.draft-list { list-style: none; padding: 0; margin: 0; }
.draft-list li { border-top: 1px solid var(--line); }
.draft-list a { display: flex; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--ink); align-items: center; }
.draft-list img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; background: var(--subtle); }
.post-photo { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--subtle); }
video.post-photo { max-height: 70vh; background: #000; }
.cover-form { display: flex; gap: 10px; align-items: center; margin: 10px 0 0; }
.cover-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.link-button { display: inline; width: auto; padding: 0; margin: 0; border: 0; background: none; color: var(--brand);
  font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; min-height: 0; }
.upload-progress { height: 6px; border-radius: 3px; background: var(--subtle); overflow: hidden; margin-top: 8px; }
.upload-progress > div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.aspects { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.aspects button { padding: 6px 12px; font-size: .9rem; }
.aspects button.selected { background: var(--brand-tint); color: var(--brand); border-color: var(--lavender-soft); }
.warn-box { background: var(--warn-tint); border-color: #ead9b0; }
.warn-box ul { margin: 6px 0 0; padding-left: 20px; }
/* Check before posting: closed by default; tap the bar to slide it open. */
details.warn-box { width: auto; }
.warn-box summary { list-style: none; display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); }
.warn-box summary::-webkit-details-marker { display: none; }
.warn-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ead9b0; font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.warn-box .caret { margin-left: auto; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
.warn-box[open] .caret { transform: translateY(2px) rotate(-135deg); }
.warn-box[open] ul { animation: warn-open .2s ease-out; }
@keyframes warn-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
textarea.has-placeholder { border-color: var(--warn); }
select { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font: inherit; font-weight: 400; border: 1px solid var(--line-input); border-radius: 10px; background: #fff; }
button.wide { width: 100%; margin-top: 8px; }
.counter { text-align: right; margin: -4px 0 0; color: var(--muted); }
.counter.over { color: var(--alert); font-weight: 600; }

/* Instagram connection */
.note-error { background: var(--alert-tint); color: var(--alert); padding: 10px 12px; border-radius: 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.button-row form { margin: 0; }
code.copyable { display: block; overflow-wrap: anywhere; user-select: all; background: var(--page); padding: 8px; border-radius: 8px; }

/* Posting */
.status-box { padding: 14px 16px; }
.status-posting { background: var(--warn-tint); }
.status-posted { background: var(--ok-tint); }
.status-failed { background: var(--alert-tint); color: var(--alert); }
.note-warn { background: var(--warn-tint); padding: 8px 10px; border-radius: 8px; }
.posted-caption { white-space: pre-wrap; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--subtle); margin-right: 4px; }
.badge-posted, .badge-tested { background: var(--ok-tint); color: var(--ok); }
.badge-failed { background: var(--alert-tint); color: var(--alert); }
.badge-posting { background: var(--warn-tint); }
.history-link { display: block; margin: -4px 0 8px 76px; }

/* Four menu items must fit a 375 px phone */
@media (max-width: 420px) {
  .topbar { gap: 6px; padding: 12px 10px; }
  .brand { font-size: 15px; }
  .topbar nav { gap: 0; }
  .topbar nav a { padding: 6px 8px; font-size: 15px; }
}

/* Auto-approve countdown */
.countdown { display: flex; align-items: center; gap: 14px; background: var(--brand-tint); border-color: var(--lavender-soft); }
.countdown-num { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }
.countdown-text { flex: 1; min-width: 0; }
.countdown-cancel { flex: none; font-weight: 600; }
.countdown.cancelled { background: var(--subtle); border-color: var(--line); }

/* Offline page */
.offline { text-align: center; margin-top: 24px; }
.offline img { border-radius: 16px; }

.clips { margin-top: 12px; }
.clips ol { list-style: none; margin: 6px 0 0; padding: 0; }
.clips li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--subtle); }
.clips li:first-child { border-top: 0; }
.clips li img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.clips li span { flex: 1; }
.clips form { margin: 0; }
.clip-move { width: 40px; min-height: 36px; padding: 4px 0; }

.carousel-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  border-radius: 10px; }
.carousel-strip figure { flex: 0 0 100%; margin: 0; scroll-snap-align: center; }
.carousel-strip img, .carousel-strip video { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain;
  border-radius: 10px; background: #000; }
.carousel-strip figcaption { text-align: center; margin-top: 4px; }
/* Property picker (Aryeo shoots) and the facts card */
.property-picker select { margin-top: 8px; color: var(--ink); }
.day-step { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-step .day-label { font-weight: 700; }
/* Tapping the date opens the phone's calendar: a see-through date input sits over the label. */
.day-pick { position: relative; flex: 1; text-align: center; padding: 8px 4px; border-radius: 10px; cursor: pointer; margin: 0; }
.day-pick:active { background: var(--brand-tint); }
.day-cal { font-size: .9rem; }
.day-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0;
  font-size: 16px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.day-btn { width: 44px; height: 40px; padding: 0; margin: 0; font-size: 1.4rem; line-height: 1; }
.facts { list-style: none; padding: 0; margin: 8px 0; }
.facts li { border-top: 1px solid var(--line); }
.facts label.check { margin: 8px 0; }
.fact-value { overflow-wrap: anywhere; }
.fact-value.long { display: block; font-size: .85rem; color: var(--muted); max-height: 7.5em; overflow: auto; }

/* Photos from this listing */
.listing-photos { margin-top: 10px; }
.listing-photos-open { margin-top: 0; }
/* Each tile's height comes from padding (2:3), which iPhone Safari keeps inside a scrolling grid; aspect-ratio got squashed. */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 6px;
  margin-top: 10px; max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.listing-photos [hidden] { display: none; }
.photo-tile { display: block; position: relative; width: 100%; height: 0; padding: 0 0 66.67%; margin: 0; border: 3px solid transparent;
  border-radius: 8px; background: var(--brand-tint); overflow: hidden; box-sizing: border-box; }
.photo-tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-tile.picked { border-color: var(--brand); }
.photo-num { position: absolute; top: 4px; right: 4px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; line-height: 24px; text-align: center; }
.photo-num:empty { display: none; }
