:root {
  --paper: #f4f0e8;
  --paper-2: #ebe4d8;
  --card: #fffcf8;
  --ink: #1a1714;
  --muted: #6d6560;
  --faint: #8a8178;
  --line: rgba(40, 28, 16, 0.1);
  --line-strong: rgba(40, 28, 16, 0.16);
  --accent: #e23d12;
  --accent-ink: #fff7f3;
  --good: #157a45;
  --good-bg: #e7f6ee;
  --bad: #b42318;
  --bad-bg: #fdeceb;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 50px rgba(70, 46, 20, 0.06);
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(226, 61, 18, 0.06), transparent 50%),
    var(--paper);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", "Helvetica Neue", sans-serif;
  letter-spacing: -0.011em;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  backdrop-filter: blur(16px);
  background: rgba(244, 240, 232, 0.86);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: Palatino, "Iowan Old Style", Georgia, serif;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: inherit;
  text-decoration: none;
}
nav { display: flex; gap: 6px; padding: 4px; background: rgba(255, 252, 248, 0.7); border: 1px solid var(--line); border-radius: 999px; }
.nav {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.nav kbd {
  font: 11px/1 ui-monospace, monospace;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 4px;
}
.nav.on { background: var(--ink); color: #fff8f3; }
.nav.on kbd { color: #fff8f3; border-color: transparent; }
main { max-width: 1120px; margin: 0 auto; padding: 28px 32px 80px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); gap: 22px; align-items: start; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.composer { padding: 22px 22px 18px; }
.preview-card { padding: 16px; position: sticky; top: 84px; }
h1 {
  font-family: Palatino, "Iowan Old Style", Georgia, serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0 0 6px;
}
.lead { color: var(--muted); margin: 0 0 18px; }
.pills, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill, .ghost, .small, .chip {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: 7px 12px;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.pill:hover, .ghost:hover, .small:hover, .chip:hover { transform: translateY(-1px); }
.pill.on { color: white; border-color: transparent; }
.accounts { display: grid; gap: 2px; margin: 14px 0 8px; }
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px;
  border-radius: 12px;
}
.check:hover { background: rgba(40, 28, 16, 0.03); }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.who { display: inline-flex; gap: 8px; align-items: center; }
.swatch { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
textarea, input[type="text"], input[type="url"], input[type="date"], input[type="time"] {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
}
textarea {
  min-height: 168px;
  resize: vertical;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: -0.02em;
  border: 0;
  padding: 4px 2px 8px;
  background: transparent;
}
textarea:focus { outline: none; }
.editor {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 12px 14px 10px;
  background: #fff;
}
.meter { display: flex; justify-content: space-between; color: var(--faint); font-size: 13px; }
.meter.over { color: var(--bad); }
.hash-chip { font-size: 14px; }
.hash-chip.on { background: var(--ink); color: #fff8f3; border-color: var(--ink); }
.drop {
  margin-top: 14px;
  border: 1px dashed rgba(40, 28, 16, 0.22);
  border-radius: 16px;
  padding: 16px;
  background: #faf7f2;
  text-align: center;
  color: var(--muted);
  transition: border-color 120ms ease, background 120ms ease;
}
.drop.over { border-color: var(--accent); background: #fff4ee; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: flex-start; }
.thumb {
  position: relative;
  width: 84px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1714;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-move { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 2px; }
.thumb-move button { position: static; width: 18px; height: 18px; }
.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 99px;
  background: rgba(20, 16, 12, 0.72);
  color: white;
  line-height: 22px;
  padding: 0;
}
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.primary, .secondary {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: 0 16px;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:active { transform: scale(0.98); }
.secondary { background: var(--ink); color: #fff8f3; }
.primary:disabled { opacity: 0.55; }
.hint { color: var(--faint); font-size: 13px; }
.error { color: var(--bad); }
.prompt {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #fff8f2;
  border: 1px solid #f0d7c8;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.preview-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.preview-tabs button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}
.preview-tabs button.on { border-color: var(--ink); background: var(--ink); color: white; }
.preview-tabs button.off { opacity: 0.45; }
.phone {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: white;
}
.phone-head, .phone-foot { display: flex; gap: 10px; align-items: center; padding: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; color: white; font-size: 13px; font-weight: 650; }
.phone-name { font-weight: 650; font-size: 14px; }
.phone-sub { color: var(--faint); font-size: 12px; }
.phone-body { padding: 0 12px 12px; white-space: pre-wrap; font-size: 14.5px; }
.frame { background: #111; display: grid; place-items: center; color: white; overflow: hidden; }
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; }
.yt-title { font-weight: 700; padding: 10px 12px 0; }
.history { margin-top: 28px; }
.seg { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,252,248,0.8); margin: 8px 0 14px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 7px 12px; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff8f3; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.day {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  min-height: 72px;
  padding: 8px;
  text-align: left;
}
.day strong { display: block; font-size: 13px; }
.day em { font-style: normal; color: var(--faint); font-size: 12px; }
.day.on { border-color: var(--ink); }
.post {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.post img.mini, .mini-fallback {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: #1a1714;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f6f1e8;
  font-size: 13px;
}
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--faint); }
.dot.published, .pill-status.connected { background: var(--good); }
.dot.failed, .dot.needs_login, .dot.partial { background: var(--bad); }
.dot.publishing, .dot.queued, .dot.scheduled, .dot.awaiting { background: var(--warn); }
.pill-status { border-radius: 999px; padding: 3px 8px; font-size: 12px; background: #f3efe8; color: var(--muted); }
.pill-status.connected { background: var(--good-bg); color: var(--good); }
.pill-status.not_connected { background: #f3efe8; color: var(--muted); }
.pill-status.needs_login { background: var(--bad-bg); color: var(--bad); }
.pill-status.awaiting { background: var(--warn-bg); color: var(--warn); }
.banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: #fff6ee;
  border: 1px solid #f0d2c2;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.brand-block { padding: 18px 18px 8px; margin-bottom: 14px; }
.brand-block h2 { margin: 0 0 4px; font-size: 22px; display: flex; gap: 8px; align-items: center; }
.logo-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 14px; }
.logo-btn {
  min-height: 64px;
  min-width: 108px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  position: relative;
}
.logo-btn .logo { width: 22px; height: 22px; display: grid; place-items: center; }
.logo-btn em { font-style: normal; font-size: 11px; color: var(--muted); }
.logo-btn.facebook { color: #1877f2; border-color: #1877f2; }
.logo-btn.instagram { color: #c13584; border-color: #c13584; }
.logo-btn.tiktok { color: #111; border-color: #111; }
.logo-btn.linkedin { color: #0a66c2; border-color: #0a66c2; }
.logo-btn.youtube { color: #e11d48; border-color: #e11d48; }
.logo-btn.on { color: white; }
.logo-btn.facebook.on { background: #1877f2; }
.logo-btn.instagram.on { background: #c13584; }
.logo-btn.tiktok.on { background: #111; }
.logo-btn.linkedin.on { background: #0a66c2; }
.logo-btn.youtube.on { background: #e11d48; }
.logo-btn.on em { background: white; color: #157a45; border-radius: 99px; padding: 1px 6px; }
.signin {
  position: fixed; inset: 0; z-index: 30; background: #1a1714; color: white;
  display: flex; flex-direction: column;
}
.signin-bar, .signin-tools { display: flex; gap: 8px; align-items: center; padding: 10px; flex-wrap: wrap; }
.signin img { width: min(430px, 100%); height: auto; margin: 0 auto; background: #000; cursor: crosshair; }
.signin-tools input { flex: 1; min-width: 140px; }
.platform-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.platform-row .name { font-weight: 650; }
.icon { width: 28px; height: 28px; display: grid; place-items: center; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(22, 16, 12, 0.72);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 24px;
}
.lightbox img { max-width: min(960px, 100%); max-height: 80vh; border-radius: 12px; }
.lightbox-close { position: absolute; top: 16px; right: 16px; }
.rail { display: none; }
.stage { min-height: 100%; }
.top-actions { display: flex; gap: 8px; align-items: center; }
#install-app { min-height: 44px; }
.update-banner {
  position: fixed;
  z-index: 28;
  left: 12px;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #1a1714;
  color: #fff8f3;
  border-radius: 14px;
  padding: 10px 12px;
}
.update-banner button { background: #fff; color: #1a1714; min-height: 40px; }
.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0 14px;
}
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.tile {
  position: relative;
  min-height: 76px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  text-align: left;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tile.on { border-color: transparent; color: white; }
.tile .tick { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 99px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; }
.tile.on .tick { background: white; color: #1a1714; border-color: white; }
.sheet-btn { width: 100%; min-height: 48px; }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 12;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px rgba(40, 24, 10, 0.16);
  transform: translateY(110%);
  transition: transform 220ms ease;
}
.sheet.open { transform: translateY(0); }
.sheet-grab { width: 42px; height: 4px; border-radius: 99px; background: #ddd4c8; margin: 0 auto 10px; }
.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 252, 248, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 8;
}
.tab {
  min-height: 48px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
}
.tab.on { color: var(--ink); background: rgba(26, 23, 20, 0.06); }
.tab-icon { font-size: 16px; }
main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.top { padding-top: calc(14px + env(safe-area-inset-top)); }
.install {
  background: #1a1714;
  color: #fff8f3;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.install button { color: #fff8f3; border-color: rgba(255,255,255,0.2); }
@media (max-width: 959px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-card { display: none; }
  .rail { display: none; }
  h1 { font-size: 34px; }
  main, .top { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 960px) {
  body { display: grid; grid-template-columns: 220px 1fr; }
  .rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px;
    border-right: 1px solid var(--line);
    min-height: 100vh;
    position: sticky;
    top: 0;
  }
  .rail-nav { display: flex; flex-direction: column; gap: 6px; }
  .rail .nav { justify-content: flex-start; min-height: 44px; }
  .tabs, .mobile-mark, .sheet { display: none !important; }
  .preview-card { display: block; }
  main { padding-bottom: 48px; }
  .stage { min-width: 0; }
  .update-banner { left: 236px; bottom: 16px; }
}

/* High-contrast fix for in-app sign-in modal and account inputs */
.brand-block input { background: #fff; color: var(--ink); }
.signin input, .signin textarea { background: #fff; color: var(--ink); border: 1px solid rgba(255,255,255,0.28); border-radius: 10px; padding: 8px 12px; }
.signin input::placeholder { color: var(--muted); }
.signin button.secondary, .signin button.ghost, .signin button.small { background: #fff; color: var(--ink); border-color: rgba(255,255,255,0.3); }
.signin button.primary { background: var(--accent); color: #fff; }
