:root {
  font-family: "Instrument Sans", "Inter", system-ui, sans-serif;
  color: #221c35;
  background: #f5f4fa;
  color-scheme: light;
  --ink: #221c35;
  --muted: #655c77;
  --primary: #5935c0;
  --primary-hover: #4624a3;
  --line: #ded9ea;
  --soft: #f0ebfd;
  --white: #fff;
  --danger: #a02c46;
  --success: #17604a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid #8969e6; outline-offset: 3px; }
p, h1, h2 { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.08; letter-spacing: -.048em; }
h2 { font-size: 1.125rem; line-height: 1.35; letter-spacing: -.02em; }
.topbar {
  min-height: 4.6rem;
  background: #16122a;
  color: #f9f7ff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: .85rem max(1.35rem, calc((100vw - 72rem) / 2));
}
.wordmark { display: inline-flex; justify-self: start; align-items: center; gap: .7rem; color: inherit; text-decoration: none; font-weight: 710; white-space: nowrap; }
.mark {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .72rem;
  background: #d4c2ff; color: #281753; font-weight: 780; font-size: 1.22rem;
}
.nav { display: flex; gap: .2rem; }
.nav button, .sign-out {
  border: 0; background: transparent; color: #d4cee4; font-weight: 625; font-size: .9rem;
  padding: .66rem .86rem; border-radius: .55rem; white-space: nowrap;
}
.nav button:hover, .nav button[aria-current], .sign-out:hover { background: #342a50; color: #fff; }
.sign-out { justify-self: end; }
main { max-width: 72rem; margin: auto; padding: 3.35rem 1.35rem; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.page-title p, .auth > p:not(.platform) { margin-top: .6rem; color: var(--muted); line-height: 1.55; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: 1.15rem; }
.panel { border: 1px solid var(--line); border-radius: 1.12rem; background: var(--white); box-shadow: 0 3px 10px #25153b07; }
.editor, .preview, .connection, .auth { padding: 1.42rem; }
.auth { width: min(100%, 28rem); margin: clamp(.65rem, 10vh, 7rem) auto; padding: clamp(1.4rem, 6vw, 2.15rem); }
.auth .platform { margin: 0 0 1.2rem; }
.auth form { margin-top: 1.6rem; }
.auth form .primary { width: 100%; }
.connection { max-width: 40rem; }
.connection-heading { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.45rem; }
.connection-heading p { color: var(--muted); margin-top: .2rem; font-size: .9rem; }
.kinds { display: flex; background: #f4f1fa; border: 1px solid #eee9f6; gap: .28rem; padding: .27rem; border-radius: .75rem; margin: 1rem 0 1.38rem; }
.kinds button { flex: 1; padding: .58rem .28rem; border: 1px solid transparent; background: transparent; border-radius: .54rem; font-size: .9rem; color: #554963; font-weight: 690; }
.kinds button:hover { color: var(--primary); }
.kinds button[aria-pressed="true"] { background: white; color: var(--primary); border-color: #e2d9f0; box-shadow: 0 1px 3px #3923560f; }
label { display: block; font-size: .91rem; font-weight: 680; margin-bottom: 1rem; }
label[for="caption"] { margin-bottom: .43rem; }
label small { color: var(--muted); margin-left: .27rem; font-weight: 450; font-size: .82rem; }
input:not([type="checkbox"]), textarea, select { display: block; width: 100%; min-width: 0; background: #fff; border: 1px solid #cfc8dd; border-radius: .58rem; padding: .65rem .76rem; color: var(--ink); }
label input:not([type="checkbox"]) { margin-top: .45rem; }
input::placeholder, textarea::placeholder { color: #787083; opacity: 1; }
textarea { resize: vertical; min-height: 7.8rem; line-height: 1.55; margin-bottom: 1rem; }
.counter { float: right; font-size: .81rem; font-weight: 510; color: var(--muted); }
.checkbox { display: flex; gap: .45rem; align-items: center; font-weight: 510; }
input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--primary); }
.upload-label { padding: .8rem; border: 1px dashed #bbaadf; background: #faf8ff; border-radius: .65rem; }
.upload-label span { display: block; font-size: .83rem; font-weight: 450; color: var(--muted); margin-top: .21rem; }
.upload-label input[type="file"] { border: 0; background: transparent; padding: .2rem 0; font-weight: 450; }
input[type="file"]::file-selector-button { border: 1px solid #d1c3ea; border-radius: .47rem; color: var(--primary); background: white; padding: .45rem .55rem; margin-right: .48rem; cursor: pointer; }
.help { color: var(--muted); font-size: .86rem; line-height: 1.55; margin-bottom: .9rem; }
.form-actions { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.primary, .secondary, .page-chip {
  border: 1px solid transparent; border-radius: .58rem; font-weight: 690; font-size: .9rem;
  line-height: 1.25; padding: .70rem .90rem;
}
.primary { color: white; background: var(--primary); }
.primary:hover { background: var(--primary-hover); }
.primary:disabled { background: #756897; color: #fff; }
.secondary { background: white; color: #43277d; border-color: #d9cdef; }
.secondary:hover { background: #f6f1ff; }
.secondary:disabled { color: #695d7a; background: #f8f6fb; }
.page-chip { display: flex; gap: .48rem; align-items: center; justify-content: center; color: #422685; background: #ede6fd; border-color: #e1d4fc; white-space: nowrap; }
.page-chip:hover { background: #e8dcff; }
.page-picker { width: min(100%, 18rem); margin: 0; }
.page-picker select { margin-top: .35rem; }
.connected-pages { margin: 0 0 1rem; padding-inline-start: 1.25rem; color: var(--muted); }
.connected-pages li + li { margin-top: .35rem; }
#facebook-config-form { border-top: 1px solid var(--line); padding-top: 1rem; }
#facebook-config-form h2 { margin-bottom: .85rem; }
#connection-feedback { margin-top: .8rem; }
.preview-heading { display: flex; align-items: center; gap: .5rem; justify-content: space-between; margin-bottom: 1rem; }
.platform { display: inline-flex; align-items: center; gap: .35rem; font-size: .81rem; font-weight: 690; color: #49398a; background: #f0ebfd; border-radius: 1rem; padding: .32rem .58rem; white-space: nowrap; }
.platform span, .avatar { display: grid; place-items: center; font-weight: 770; }
.platform span { width: .95rem; height: .95rem; border-radius: 50%; background: #5840ad; color: white; font-family: Arial, sans-serif; }
.avatar { width: 2.35rem; height: 2.35rem; border-radius: 50%; background: #e9defc; color: #52319e; flex: none; }
.post-preview { border: 1px solid #e6e0ef; border-radius: .78rem; padding: .88rem; overflow: hidden; }
.post-meta { display: flex; gap: .65rem; align-items: center; }
.post-meta strong, .post-meta div span { display: block; }
.post-meta div span { font-size: .84rem; color: var(--muted); margin-top: .19rem; }
#preview-caption { margin: .75rem 0 .15rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.placeholder { color: var(--muted); }
.preview-link { color: var(--primary); overflow-wrap: anywhere; font-size: .9rem; margin-top: .48rem; }
.post-preview img, .post-preview video, .media-empty { margin-top: .7rem; width: 100%; border-radius: .55rem; }
.post-preview img, .post-preview video { max-height: 28rem; object-fit: contain; background: #19142a; }
.media-empty { display: grid; place-items: center; text-align: center; padding: 1rem; min-height: 7.2rem; color: var(--muted); font-size: .88rem; background: #f5f2fa; }
.status { font-size: .91rem; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.status:empty { display: none; }
form .status, #activity-status { margin-top: .8rem; }
.status[data-tone="error"] { color: var(--danger); }
.status[data-tone="success"] { color: var(--success); }
.list-panel { padding: .1rem 1.25rem; }
.empty-list { padding: 1.25rem .1rem; color: var(--muted); }
.job { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .85rem .1rem; }
.job + .job { border-top: 1px solid var(--line); }
.job h2 { font-size: 1rem; overflow-wrap: anywhere; }
.job p { margin-top: .2rem; font-size: .85rem; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }
.job div { min-width: 0; }
.job-actions { flex: none; display: grid; justify-items: end; gap: .45rem; }
.badge { border-radius: 1rem; background: #efebf8; padding: .25rem .5rem; font-size: .79rem; color: #57477b; font-weight: 640; white-space: nowrap; }
.badge[data-status="public"] { background: #e3f2ec; color: var(--success); }
.badge[data-status="failed"], .badge[data-status="review"] { background: #fae9ee; color: var(--danger); }
.job-actions button { padding: .38rem .5rem; font-size: .81rem; }
dialog { background: #fff; color: var(--ink); width: min(calc(100% - 2rem), 29rem); border: 1px solid var(--line); border-radius: 1rem; padding: 1.35rem; }
dialog::backdrop { background: #16122a9c; }
dialog p { margin: .55rem 0 1rem; line-height: 1.55; color: var(--muted); }
@media (max-width: 48rem) {
  .workspace { grid-template-columns: 1fr; }
  main { padding-top: 2rem; }
  .preview { max-width: 34rem; width: 100%; }
}
@media (max-width: 36rem) {
  .topbar { grid-template-columns: 1fr auto; padding: .7rem .95rem; gap: .55rem; }
  .nav { grid-column: 1 / -1; grid-row: 2; }
  .sign-out { grid-column: 2; grid-row: 1; }
  .nav button, .sign-out { padding: .47rem .6rem; }
  main { padding-inline: .9rem; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .editor, .preview, .connection { padding: 1rem; }
  .form-actions > * { flex: 1 1 auto; text-align: center; justify-content: center; }
}
