/* ==========================================================================
   PostPilot — design system
   ========================================================================== */

:root {
  /* Ink — near-black with a hint of blue, not pure grey */
  --ink:          #14161c;
  --ink-2:        #3a4150;
  --muted:        #6b7280;
  --faint:        #9ca3af;

  /* Surfaces — warm off-white, so white cards lift off the page */
  --bg:           #f6f5f3;
  --card:         #ffffff;
  --line:         #e7e5e1;
  --line-soft:    #f1efec;

  /* Primary — deep indigo, richer than a stock blue */
  --brand:        #3730a3;
  --brand-600:    #312e81;
  --brand-700:    #272263;
  --brand-50:     #eeedf9;
  --brand-100:    #ddd9f2;

  /* Champagne accent, used sparingly for premium detail */
  --gold:         #b08d57;
  --gold-soft:    #f3ece1;

  --yellow:       #d9a441;
  --green:        #2f7d5d;
  --pink:         #b4436c;
  --orange:       #c2703d;
  --red:          #b4443c;

  /* Graphite sidebar */
  --panel:        #17181d;
  --panel-2:      #1f2128;
  --panel-line:   #2b2d35;
  --panel-ink:    #e8e6e1;
  --panel-muted:  #8b8f99;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Layered, low-opacity shadows read as expensive; single hard ones do not */
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, .04), 0 1px 1px rgba(20, 22, 28, .03);
  --shadow:    0 2px 4px rgba(20, 22, 28, .03), 0 8px 24px rgba(20, 22, 28, .06);
  --shadow-lg: 0 4px 8px rgba(20, 22, 28, .04), 0 24px 64px rgba(20, 22, 28, .14);

  --sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --ink:        #ece9e4;
  --ink-2:      #c3c7d0;
  --muted:      #8b8f99;
  --faint:      #5f636d;
  --bg:         #101116;
  --card:       #191b21;
  --line:       #282a32;
  --line-soft:  #202229;
  --brand:      #8b83e8;
  --brand-600:  #7a71e0;
  --brand-700:  #a49dee;
  --brand-50:   #21203a;
  --brand-100:  #2b2950;
  --gold:       #c9a870;
  --gold-soft:  #2a2418;
  --panel:      #0c0d11;
  --panel-2:    #14151a;
  --panel-line: #23252c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow:    0 8px 24px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .65);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -.005em;
  font-feature-settings: "cv05" 1, "ss01" 1;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.08;
  margin: 0 0 .45em;
}
h3, h4 {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -.012em;
  line-height: 1.25;
  margin: 0 0 .5em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.0625rem; }
p  { margin: 0 0 1em; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.muted    { color: var(--muted); }
.small    { font-size: .8125rem; }
.tiny     { font-size: .75rem; }
.center   { text-align: center; }
.mono     { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; }
.nowrap   { white-space: nowrap; }
.stack    { display: flex; flex-direction: column; gap: 14px; }
.row      { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.grow     { flex: 1; }
.hide     { display: none !important; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 19px;
  font: inherit; font-weight: 550; font-size: .9063rem; letter-spacing: -.005em;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--brand); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--shadow-sm);
  cursor: pointer; text-decoration: none;
  transition: transform .14s cubic-bezier(.2,.8,.3,1), box-shadow .14s ease, background .14s ease, border-color .14s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-600); text-decoration: none; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), var(--shadow); }
.btn:active { transform: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost   { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); box-shadow: none; }
.btn-soft    { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); }
.btn-danger  { background: var(--red); }
.btn-danger:hover { background: #dc2626; }
.btn-sm      { padding: 6px 13px; font-size: .8125rem; border-radius: 8px; }
.btn-lg      { padding: 14px 30px; font-size: 1rem; border-radius: 12px; }
.btn-block   { width: 100%; }
.btn-icon    { padding: 8px; border-radius: 10px; }

/* ---------- Forms ---------- */

.field { display: block; margin-bottom: 16px; }
.field > label,
.label {
  display: block; margin-bottom: 7px;
  font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--muted);
}

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=date], input[type=time], input[type=datetime-local], input[type=search],
select, textarea {
  width: 100%; padding: 11px 14px;
  font: inherit; color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(55, 48, 163, .12);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

.hint { font-size: .75rem; color: var(--muted); margin-top: 5px; }

/* ---------- Cards / surfaces ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease;
}
.card-pad { padding: 24px; }
.card-head {
  padding: 19px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; }

/* ---------- Badges & pills ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 6px;
  font-size: .625rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: var(--line-soft); color: var(--muted);
}
.badge-scheduled  { background: var(--brand-50);        color: var(--brand-700); }
.badge-published  { background: rgba(34, 197, 94, .14); color: #15803d; }
.badge-draft      { background: rgba(148, 163, 184, .2); color: var(--muted); }
.badge-failed     { background: rgba(239, 68, 68, .14); color: #b91c1c; }
.badge-publishing { background: rgba(250, 204, 21, .2); color: #a16207; }
.badge-admin      { background: rgba(236, 72, 153, .14); color: #be185d; }
.badge-active     { background: rgba(34, 197, 94, .14); color: #15803d; }
.badge-suspended  { background: rgba(239, 68, 68, .14); color: #b91c1c; }

[data-theme="dark"] .badge-published,
[data-theme="dark"] .badge-active { color: #4ade80; }
[data-theme="dark"] .badge-failed,
[data-theme="dark"] .badge-suspended { color: #f87171; }
[data-theme="dark"] .badge-scheduled { color: #93c5fd; }

/* Platform chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
}
.chip svg { flex: none; }
.pdot {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; flex: none;
}
.pdot-sm { width: 17px; height: 17px; }

/* ---------- Alerts ---------- */

.alert {
  padding: 12px 16px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card);
  font-size: .875rem; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: rgba(34, 197, 94, .1);  border-color: rgba(34, 197, 94, .35);  color: #15803d; }
.alert-error   { background: rgba(239, 68, 68, .09); border-color: rgba(239, 68, 68, .35);  color: #b91c1c; }
.alert-info    { background: var(--brand-50);        border-color: var(--brand-100);        color: var(--brand-700); }
.alert-warn    { background: rgba(250, 204, 21, .14);border-color: rgba(250, 204, 21, .4);  color: #a16207; }

[data-theme="dark"] .alert-success { color: #4ade80; }
[data-theme="dark"] .alert-error   { color: #f87171; }
[data-theme="dark"] .alert-warn    { color: #fbbf24; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th {
  text-align: left; padding: 12px 16px;
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--line-soft); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .75rem; flex: none;
}

/* ==========================================================================
   App shell
   ========================================================================== */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px; flex: none;
  background: var(--panel);
  border-right: 1px solid var(--panel-line);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  color: var(--panel-ink);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--panel-line); border-radius: 99px; }

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 8px 24px;
  font-family: var(--display); font-weight: 400; font-size: 1.375rem;
  letter-spacing: -.01em; color: var(--ink);
}
.sidebar .brand { color: var(--panel-ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(150deg, #4f46b8, var(--brand) 60%, #211d5c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  display: grid; place-items: center; color: #fff;
}

.nav-label {
  padding: 20px 12px 7px;
  font-size: .625rem; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--panel-muted);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--panel-muted); font-weight: 500; font-size: .9063rem;
  transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: var(--panel-2); text-decoration: none; color: var(--panel-ink); }
.nav-item.active { background: var(--panel-2); color: #fff; font-weight: 550; }
/* A thin champagne rule marks the current page */
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 2px; border-radius: 2px; background: var(--gold);
}
.nav-item svg { flex: none; opacity: .7; }
.nav-item.active svg { opacity: 1; }
.nav-count {
  margin-left: auto; font-size: .6875rem; font-weight: 600;
  background: var(--panel-line); color: var(--panel-muted);
  padding: 1px 8px; border-radius: 999px;
}

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--panel-line); }
.sidebar-foot .tiny { color: var(--panel-muted) !important; }
.sidebar-foot div[style*="font-weight:600"] { color: var(--panel-ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 34px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin: 0; }
.page { padding: 32px 34px 72px; }
.page-narrow { max-width: 760px; }

.menu-toggle { display: none; }

/* ---------- Stat tiles ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 22px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: var(--brand);
}
.stat.s-green::after  { background: var(--green); }
.stat.s-yellow::after { background: var(--yellow); }
.stat.s-pink::after   { background: var(--pink); }
.stat.s-red::after    { background: var(--red); }
.stat .k { font-size: .6875rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stat .v { font-family: var(--display); font-size: 2.25rem; font-weight: 400; letter-spacing: -.02em; margin-top: 6px; line-height: 1; }

/* ==========================================================================
   Calendar
   ========================================================================== */

.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.cal-title { font-family: var(--display); font-size: 1.625rem; font-weight: 400; letter-spacing: -.01em; margin: 0; min-width: 220px; }

.seg { display: inline-flex; background: var(--line-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a, .seg button {
  padding: 6px 15px; border-radius: 7px; border: 0; background: transparent;
  font: inherit; font-size: .8125rem; font-weight: 550; color: var(--muted); cursor: pointer;
}
.seg a:hover, .seg button:hover { text-decoration: none; color: var(--ink); }
.seg .on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

.cal {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.cal-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--line-soft); border-bottom: 1px solid var(--line);
}
.cal-dow div {
  padding: 10px 12px; font-size: .6875rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted); text-align: left;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 132px; padding: 8px; border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft); position: relative;
  display: flex; flex-direction: column; gap: 5px;
  transition: background .12s ease;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--line-soft); }
.cal-cell.today .daynum {
  background: var(--brand); color: #fff;
  width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center;
}
.cal-cell.drop { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand); }
.daynum { font-size: .8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.cal-cell.out .daynum { color: var(--faint); font-weight: 500; }

.add-slot {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; border-radius: 7px; border: 0;
  background: var(--brand-50); color: var(--brand);
  font-size: 15px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .12s ease;
}
.cal-cell:hover .add-slot { opacity: 1; }

.ev {
  display: block; width: 100%; text-align: left;
  border: 0; border-left: 3px solid var(--brand);
  background: var(--line-soft); color: var(--ink);
  border-radius: 7px; padding: 5px 7px; cursor: grab;
  font-size: .75rem; line-height: 1.35;
  transition: transform .1s ease, box-shadow .1s ease;
}
.ev:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.ev.dragging { opacity: .4; }
.ev-time { font-weight: 700; font-size: .6875rem; color: var(--muted); display: block; }
.ev-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-icons { display: flex; gap: 3px; margin-top: 4px; }
.ev.st-published { border-left-color: var(--green); }
.ev.st-draft     { border-left-color: var(--faint); }
.ev.st-failed    { border-left-color: var(--red); }
.ev.st-publishing{ border-left-color: var(--yellow); }
.ev-more { font-size: .6875rem; color: var(--muted); font-weight: 600; padding-left: 4px; }

/* Week / list layouts */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.week-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 220px; display: flex; flex-direction: column; gap: 6px; }
.week-col h4 { margin: 0 0 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.week-col.today { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }

/* Grid (feed) preview */
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 420px; }
.feed-cell { aspect-ratio: 1; background: var(--line-soft); border-radius: 3px; overflow: hidden; position: relative; }
.feed-cell img, .feed-cell video { width: 100%; height: 100%; object-fit: cover; }
.feed-cell .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; font-size: .6875rem; color: var(--muted); text-align: center; overflow: hidden; }

/* ==========================================================================
   Composer modal
   ========================================================================== */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 22, 28, .5);
  backdrop-filter: blur(6px) saturate(120%); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 940px;
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head {
  padding: 20px 26px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 24px 26px; }
.modal-foot {
  padding: 18px 26px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.x-close {
  border: 0; background: transparent; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.x-close:hover { background: var(--line-soft); color: var(--ink); }

.composer { display: grid; grid-template-columns: 1fr 300px; gap: 26px; }

.acct-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.acct {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 8px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card);
  cursor: pointer; font-size: .8125rem; font-weight: 600; color: var(--ink-2);
  transition: border-color .12s ease, background .12s ease;
}
.acct:hover { border-color: var(--faint); }
.acct input { position: absolute; opacity: 0; pointer-events: none; }
.acct.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }

.counter { font-size: .75rem; font-weight: 600; color: var(--muted); }
.counter.warn { color: var(--orange); }
.counter.over { color: var(--red); }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r);
  padding: 22px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: .8125rem;
  transition: border-color .12s ease, background .12s ease;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.media-preview { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.media-preview img, .media-preview video { width: 100%; max-height: 260px; object-fit: cover; }
.media-remove {
  position: absolute; top: 8px; right: 8px;
  background: rgba(15, 23, 42, .8); color: #fff; border: 0;
  border-radius: 999px; padding: 4px 11px; font-size: .75rem; cursor: pointer;
}

.preview-phone {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px; background: var(--bg);
}
.pv-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.pv-name { font-weight: 700; font-size: .8125rem; }
.pv-handle { font-size: .6875rem; color: var(--muted); }
.pv-body { font-size: .8125rem; white-space: pre-wrap; word-break: break-word; }
.pv-media { margin-top: 10px; border-radius: var(--r-sm); overflow: hidden; }
.pv-media video { width: 100%; max-height: 190px; object-fit: cover; }

/* ==========================================================================
   Auth pages
   ========================================================================== */

.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px 6vw; background: var(--card); }
.auth-form { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-aside {
  background: linear-gradient(150deg, #1e3a8a, var(--brand) 55%, #7c3aed);
  color: #fff; padding: 60px 5vw; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-aside h2 { font-size: 2.25rem; max-width: 15ch; color: #fff; }
.auth-aside p { color: rgba(255, 255, 255, .82); max-width: 40ch; }
.auth-aside ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-aside li { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; color: rgba(255, 255, 255, .92); }
.tick {
  width: 20px; height: 20px; border-radius: 50%; flex: none; margin-top: 2px;
  background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 11px;
}
.blob { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }
.blob.b1 { width: 220px; height: 220px; background: var(--yellow); top: -60px; right: -40px; opacity: .25; }
.blob.b2 { width: 160px; height: 160px; background: var(--green); bottom: -50px; left: -30px; opacity: .3; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: .75rem; margin: 22px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ==========================================================================
   Marketing page
   ========================================================================== */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .site-head { background: rgba(17, 26, 43, .88); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.site-nav { display: flex; align-items: center; gap: 26px; font-size: .9375rem; font-weight: 500; }
.site-nav a { color: var(--ink-2); }

.hero { padding: 76px 0 60px; text-align: center; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2.25rem, 5.2vw, 3.75rem); max-width: 17ch; margin: 0 auto .55em; }
.hero .lede { font-size: 1.125rem; color: var(--muted); max-width: 56ch; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  padding: 6px 15px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: .8125rem; font-weight: 600;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

.logo-strip { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.logo-strip .pdot { width: 42px; height: 42px; box-shadow: var(--shadow-sm); }

.section { padding: 72px 0; }
.section-alt { background: var(--card); border-block: 1px solid var(--line); }
.section h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); text-align: center; max-width: 20ch; margin: 0 auto .4em; }
.section .sub { text-align: center; color: var(--muted); max-width: 58ch; margin: 0 auto 48px; font-size: 1.0625rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; }
.section-alt .feature { background: var(--bg); }
.feature h3 { font-size: 1.0625rem; }
.feature p { color: var(--muted); font-size: .9375rem; margin: 0; }
.f-icon {
  width: 44px; height: 44px; border-radius: 13px; margin-bottom: 16px;
  display: grid; place-items: center; color: #fff;
}

.screenshot {
  margin-top: 52px; border-radius: var(--r-xl); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--card);
}
.ss-bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--line-soft); }
.ss-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--faint); opacity: .5; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px; counter-reset: step; }
.step { counter-increment: step; }
.step::before {
  content: counter(step); display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%; margin-bottom: 14px;
  background: var(--brand); color: #fff; font-weight: 800;
}

.cta-band {
  background: linear-gradient(140deg, #1e3a8a, var(--brand) 60%, #7c3aed);
  color: #fff; border-radius: var(--r-xl); padding: 56px 40px; text-align: center;
  position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .85); max-width: 50ch; margin: 0 auto 26px; }
.cta-band .btn { background: #fff; color: var(--brand-700); }
.cta-band .btn:hover { background: var(--brand-50); }

.site-foot { padding: 40px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .composer { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { order: -1; padding: 44px 24px; }
  .auth-aside h2 { font-size: 1.75rem; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .page { padding: 18px 16px 60px; }
  .topbar { padding: 14px 16px; }
  .cal-cell { min-height: 92px; padding: 5px; }
  .ev-text, .ev-icons { display: none; }
  .ev { padding: 3px 5px; }
  .cal-dow div { padding: 8px 5px; font-size: .625rem; }
  .site-nav { display: none; }
  .week-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .btn { display: none !important; }
}

/* ==========================================================================
   Cropper — ratio picker, drag frame, zoom
   ========================================================================== */

.cropper { margin-top: 12px; }

.ratio-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ratio-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 12px; min-width: 78px;
  border: 1.5px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--ink-2);
  font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.ratio-btn:hover { border-color: var(--faint); }
.ratio-btn.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.ratio-btn .tiny { font-weight: 500; }

.ratio-box { border: 2px solid currentColor; border-radius: 3px; opacity: .75; margin-bottom: 2px; }
.ratio-box.r-square    { width: 20px; height: 20px; }
.ratio-box.r-portrait  { width: 17px; height: 21px; }
.ratio-box.r-landscape { width: 24px; height: 13px; }
.ratio-box.r-story     { width: 13px; height: 23px; }

.crop-stage { max-width: 340px; }
.crop-frame {
  position: relative; width: 100%; overflow: hidden;
  border-radius: var(--r); background: #0b1220;
  cursor: grab; touch-action: none; user-select: none;
}
.crop-frame.grabbing { cursor: grabbing; }
.crop-frame img { position: absolute; max-width: none; user-select: none; -webkit-user-drag: none; }

/* Rule-of-thirds guides, like every photo app */
.crop-guides { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.crop-guides::before, .crop-guides::after {
  content: ""; position: absolute; inset: 0;
  background-repeat: no-repeat; opacity: .3;
}
.crop-guides::before {
  background-image: linear-gradient(to right, #fff 1px, transparent 1px), linear-gradient(to right, #fff 1px, transparent 1px);
  background-position: 33.33% 0, 66.66% 0;
  background-size: 1px 100%;
}
.crop-guides::after {
  background-image: linear-gradient(to bottom, #fff 1px, transparent 1px), linear-gradient(to bottom, #fff 1px, transparent 1px);
  background-position: 0 33.33%, 0 66.66%;
  background-size: 100% 1px;
}

.crop-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.crop-controls input[type=range] {
  flex: 1; accent-color: var(--brand); height: 4px; padding: 0; border: 0; background: transparent;
}

/* ==========================================================================
   Richer preview
   ========================================================================== */

.pv-frame { position: relative; width: 100%; overflow: hidden; border-radius: 8px; background: var(--line-soft); }
.pv-frame img {
  position: absolute; max-width: none; max-height: none;
  object-fit: fill;   /* the element is already sized to the source aspect */
}

.pv-actions { display: flex; gap: 12px; margin: 9px 0 7px; font-size: 1rem; opacity: .8; }
.pv-body .tag { color: var(--brand); font-weight: 500; }
.pv-link {
  margin-top: 7px; color: var(--brand); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-meta { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Alt text + first comment */
.more-options { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.more-options summary {
  cursor: pointer; font-weight: 600; font-size: .8125rem; color: var(--brand);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.more-options summary::-webkit-details-marker { display: none; }
.more-options summary::before { content: "＋"; font-size: .875rem; }
.more-options[open] summary::before { content: "－"; }

/* ---------- Hashtag sets ---------- */

.set-bar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.set-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.set-chip:hover { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.set-chip:active { transform: translateY(1px); }
.set-note { color: var(--green); font-weight: 600; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  padding: 3px 9px; border-radius: 6px;
  background: var(--brand-50); color: var(--brand-700);
  font-size: .75rem; font-weight: 500;
}

/* ---------- Templates ---------- */

.empty-badge {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px;
  background: var(--gold-soft); color: var(--gold);
  display: grid; place-items: center;
}

.tpl-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 20px;
  background: var(--gold-soft); border: 1px solid rgba(176, 141, 87, .22);
  border-radius: var(--r);
}
.tpl-chip {
  padding: 5px 13px; border-radius: 8px;
  border: 1px solid rgba(176, 141, 87, .35); background: var(--card); color: var(--ink-2);
  font: inherit; font-size: .8125rem; font-weight: 550; cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.tpl-chip:hover { border-color: var(--gold); color: var(--ink); }
.tpl-chip.on    { background: var(--gold); border-color: var(--gold); color: #fff; }

.tpl-card { transition: box-shadow .2s ease; }
.tpl-card:hover { box-shadow: var(--shadow); }

/* ---------- Bulk upload ---------- */

.bulk-progress { margin-top: 16px; }
.bulk-bar {
  height: 5px; border-radius: 99px; background: var(--line-soft); overflow: hidden; margin-bottom: 6px;
}
.bulk-bar span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transition: width .2s ease;
}

.bulk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px; margin-top: 18px;
}
.bulk-item { display: flex; flex-direction: column; gap: 6px; }

.bulk-thumb {
  position: relative; aspect-ratio: 1; border-radius: var(--r-sm);
  overflow: hidden; background: var(--line-soft); border: 1px solid var(--line);
}
.bulk-thumb img, .bulk-thumb video { width: 100%; height: 100%; object-fit: cover; }

.bulk-x {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; border-radius: 6px; border: 0;
  background: rgba(20, 22, 28, .72); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .12s ease;
}
.bulk-thumb:hover .bulk-x { opacity: 1; }

.bulk-n {
  position: absolute; bottom: 5px; left: 5px;
  padding: 1px 7px; border-radius: 5px;
  background: rgba(20, 22, 28, .72); color: #fff;
  font-size: .6875rem; font-weight: 600;
}

.bulk-slot {
  font-size: .6875rem; font-weight: 600; letter-spacing: .02em;
  color: var(--brand); text-align: center;
}
.bulk-caption {
  font-size: .75rem !important; padding: 7px 9px !important;
  min-height: 0 !important; resize: vertical;
}
