:root {
  color-scheme: light;
  --page: #f8f7f4;
  --panel: #fffefd;
  --ink: #201c1a;
  --muted: #665c55;
  --line: #e4ded7;
  --accent: #903d26;
  --accent-soft: #f5e9e2;
  --focus: #8a4e37;
  font: 15px/1.55 system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: .18em; overflow-wrap: anywhere; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.16rem; letter-spacing: -.016em; }
h3 { font-size: 1.09rem; line-height: 1.3; }
.muted, .account, time { color: var(--muted); }
.account, time { font-size: .9rem; }

.masthead {
  min-height: 48px;
  padding: 9px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 720; text-decoration: none; }
.brand span { font-size: 1.35rem; line-height: 1; color: var(--accent); }
.workspace { border-left: 1px solid var(--line); padding-left: 18px; display: flex; gap: 14px; }
.workspace a { color: var(--muted); text-decoration: none; }
.workspace a:hover, .workspace a[aria-current="page"] { color: var(--accent); }
.workspace a[aria-current="page"] { font-weight: 680; text-decoration: underline; text-underline-offset: .34em; }
.x-theme { display: flex; flex: none; align-items: center; gap: 5px; color: var(--muted); font-size: .82rem; }
.x-theme select { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font-size: inherit; }
.local { margin-left: auto; color: var(--muted); font-size: .82rem; }
.layout {
  width: min(100% - 48px, 1360px);
  margin: 0 auto;
}
.launch-toolbar, .section-title, .launch-title, .post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.launch-toolbar { justify-content: flex-start; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
#filters { display: flex; gap: 4px; }
#new-launch { margin-left: auto; }
.filter, .quiet, .primary, #launches {
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 650;
  padding: 7px 12px;
}
.filter { border: 1px solid transparent; background: transparent; color: var(--muted); }
.filter[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.quiet { border: 1px solid var(--line); background: var(--panel); }
.quiet:hover:enabled, .filter:hover { border-color: #c9b9ae; }
.primary { border: 1px solid var(--accent); background: var(--accent); color: white; }
.primary:hover:enabled { background: #74301e; }
#launches { min-width: 0; max-width: 100%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }

main { padding: 12px 0 14px; }
.launch-title { justify-content: flex-start; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2.3rem); font-weight: 710; letter-spacing: -.045em; line-height: 1.1; overflow-wrap: anywhere; }
.launch-lead { display: grid; row-gap: 6px; padding: 4px 0; }
.launch-lead a { width: fit-content; font-size: .87rem; }
.posts-title { margin: 10px 0; flex-wrap: wrap; }
.posts-grid { display: grid; grid-template-columns: var(--post-widths, repeat(var(--post-columns), minmax(0, 1fr))); align-items: start; gap: 10px; }
.batch-actions, .post-actions, .post-meta, .source-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 15px 17px;
}
.post-card {
  --preview-height: clamp(100px, 17dvh, 148px);
  --media-space: 0px;
  padding: 10px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.post-card:has(.post-media) { --media-space: calc(var(--preview-height) + 8px); }
.post-top { justify-content: flex-start; align-items: flex-start; gap: 7px; }
.post-top > div { flex: 1; min-width: 0; }
.post-top h3, .account { overflow-wrap: anywhere; }
.post-top input { flex: none; width: 16px; height: 16px; margin: 4px 0 0; accent-color: var(--accent); }
.post-card h3 { font-size: 1rem; }
.post-card .account { font-size: .8rem; }
.status { display: inline-flex; padding: 3px 8px; border-radius: 5px; color: #524b43; background: #ece8e2; font-size: .77rem; font-weight: 660; }
.status.review, .status.planned { background: #f6eddb; color: #624816; }
.status.approved, .status.live, .status.scheduled { background: #e7efe7; color: #26513c; }
.status.changes, .status.hold { background: #f7e8e2; color: #843e30; }
.caption, .feedback, .placement p { white-space: pre-wrap; overflow-wrap: anywhere; }
.caption { margin: 11px 0; font-size: 1rem; }
.post-card .caption {
  margin: 8px 0;
  max-height: clamp(116px, 100dvh - 445px - var(--media-space), 500px);
  overflow: auto;
  font-size: .92rem;
  line-height: 1.42;
}
.feedback { padding: 9px 10px; background: var(--accent-soft); margin-bottom: 9px; border-radius: 6px; }
.post-meta { margin: 8px 0 9px; font-size: .89rem; overflow-wrap: anywhere; }
.post-media { margin-bottom: 8px; }
.post-media video, .post-media img {
  display: block;
  background: #171412;
  border-radius: 7px;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.post-card .post-media > * { height: var(--preview-height); }
.placement { font-size: .86rem; color: var(--muted); margin: 10px 0; }
summary { cursor: pointer; }
.placement p, .source-links { margin-top: 7px; }
.post-actions { padding-top: 9px; border-top: 1px solid var(--line); }
.post-card .post-actions { margin-top: auto; padding-top: 6px; }
.post-card .post-actions button { padding: 3px 9px; font-size: .8rem; }
.post-card .post-actions a { font-size: .8rem; }

.ideas-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 12px 0 15px;
}
#idea-filters { display: flex; flex-wrap: wrap; gap: 4px; }
#calendar-note { margin: -6px 0 14px; font-size: .9rem; }
#ideas-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.idea-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.idea-card-heading { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.idea-card-heading time { margin-left: auto; }
.idea-rank { color: var(--accent); font-weight: 740; font-variant-numeric: tabular-nums; }
.idea-card h2 { font-size: clamp(1.09rem, 1.5vw, 1.4rem); line-height: 1.2; letter-spacing: -.025em; }
.idea-preview { display: flex; gap: 6px; height: clamp(145px, 15vw, 205px); }
.idea-preview figure { margin: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.idea-preview a { display: block; flex: 1; min-height: 0; }
.idea-preview video, .idea-preview img {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  border-radius: 7px;
  object-fit: contain;
  background: #28211f;
}
.idea-preview video { flex: 1; }
.idea-preview figcaption { font-size: .75rem; color: var(--muted); }
.idea-placeholder {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 12px;
  width: 100%;
  border: 1px dashed #bb9382;
  background: var(--accent-soft);
  color: #57372b;
  border-radius: 7px;
  text-align: center;
}
.idea-placeholder p, .idea-reference, .idea-note { font-size: .83rem; }
.idea-opening {
  font-size: .93rem;
  font-weight: 625;
}
.idea-copy { display: grid; gap: 8px; }
.idea-copy-toolbar { display: flex; gap: 6px; }
.idea-copy-toolbar select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}
.idea-copy-text { white-space: pre-wrap; line-height: 1.45; }
.idea-notes { font-size: .86rem; }
.idea-notes > p { margin-top: 6px; }
.idea-card > p { line-height: 1.4; }
.idea-note { color: var(--muted); }
.has-posts { grid-column: 1 / -1; }
.idea-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.idea-posts:has(.feed-x) { width: 100%; max-width: 1236px; margin-inline: auto; }
.proposed-post { min-width: 0; display: grid; align-content: start; gap: 8px; padding: 6px; }
.proposed-post:has(.feed-x) { width: 100%; max-width: 612px; justify-self: center; }
.feed-preview {
  min-width: 0; display: grid; gap: 9px; padding: 12px;
  color: #19212a; background: white; border: 1px solid #e0e5e9; border-radius: 11px;
}
.post .feed-preview { margin: 8px 0; }
.feed-identity { display: flex; align-items: center; gap: 9px; line-height: 1.25; overflow-wrap: anywhere; }
.feed-identity > div { display: grid; gap: 3px; min-width: 0; }
.feed-avatar {
  display: grid; place-items: center; flex: 0 0 34px; height: 34px;
  border-radius: 9px; background: #21202b; color: white; font-size: .72rem; font-weight: 730;
}
.feed-avatar.personal { background: #e4eaf3; color: #293f59; border-radius: 50%; }
.feed-handle { color: #566674; font-size: .83rem; }
.feed-linkedin { border-radius: 8px; }
.feed-linkedin .feed-identity { padding-bottom: 4px; }
.feed-linkedin a { color: #145c91; }
.feed-preview .caption { margin: 0; }
.feed-preview .idea-preview { height: auto; gap: 8px; flex-wrap: wrap; }
.feed-preview .idea-preview video, .feed-preview .idea-preview img { height: auto; max-height: min(36dvh, 290px); border-radius: 8px; }
.feed-preview .idea-preview img { background: #f5f7f9; }
.feed-preview .idea-placeholder { min-height: 90px; }
.feed-preview .idea-preview figcaption { padding-top: 4px; }
.feed-preview .post-media { margin: 0; }
.feed-x {
  width: 100%;
  max-width: 600px;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px 8px;
  padding: 12px 16px;
  color: var(--x-ink, #17191d);
  background: var(--x-background, #fff);
  border-color: var(--x-rule, #dfe3e7);
}
.feed-x .feed-identity { display: contents; }
.feed-x .feed-identity > div {
  grid-area: 1 / 2; display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 0 6px; font-size: 15px; line-height: 20px;
}
.feed-x .feed-avatar {
  grid-column: 1; grid-row: 1 / span 2;
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
}
.feed-x .feed-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-x > :not(.feed-identity) { grid-column: 2; min-width: 0; }
.feed-x .feed-handle { color: var(--x-muted, #53606b); font-size: .91em; }
.feed-x .caption, .feed-x .idea-copy-text { font-size: 15px; line-height: 20px; }
.feed-x a { color: var(--x-link, #1769b0); }
.feed-x .idea-preview video, .feed-x .idea-preview img,
.post:not(.post-card) .feed-x .post-media > * {
  height: auto; max-height: min(60dvh, 510px); border-radius: 9px;
  background: var(--x-background, #fff);
}
.post:not(.post-card) .feed-x { margin-inline: auto; }
.feed-x .muted, .feed-x figcaption { color: var(--x-muted, #53606b); }
.feed-x .idea-placeholder {
  border-color: var(--x-rule, #dfe3e7); background: var(--x-background, #fff);
  color: var(--x-muted, #53606b);
}
.post-card .feed-x { grid-template-columns: 32px minmax(0, 1fr); padding: 8px; }
.post-card .feed-x .feed-avatar { grid-row: 1; width: 32px; height: 32px; }
.post-card .feed-x > :not(.feed-identity) { grid-column: 1 / -1; }
.post-card .feed-x .caption { font-size: .92rem; line-height: 1.42; }
:root[data-x-theme="dark"] {
  --x-ink: #f0f2f5; --x-background: #000; --x-rule: #383e45; --x-muted: #a6adb5; --x-link: #76baff;
}
@media (prefers-color-scheme: dark) {
  :root[data-x-theme="system"] {
    --x-ink: #f0f2f5; --x-background: #000; --x-rule: #383e45; --x-muted: #a6adb5; --x-link: #76baff;
  }
}
.feed-controls a, .post-actions a { font-size: .82rem; }
.proposed-post-heading, .feed-controls, .feed-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.proposed-post-heading { justify-content: space-between; }
.proposed-post-heading button, .proposed-placement button { padding: 3px 8px; font-size: .82rem; }
.feed-controls select { max-width: 12rem; padding: 3px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); font-size: .82rem; }
.feed-downloads { font-size: .8rem; padding-inline: 3px; }
.proposed-post .idea-copy-text { overflow-wrap: anywhere; }
.proposed-placement { display: grid; justify-items: start; gap: 3px; padding: 8px; border-radius: 7px; background: var(--page); font-size: .86rem; }
.idea-story { margin: 7px 0; padding-left: 20px; }
.idea-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin: auto 0 0;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.idea-empty { grid-column: 1 / -1; padding: 20px 0; }

dialog { width: min(calc(100% - 28px), 576px); padding: 22px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: rgb(32 28 26 / 48%); }
dialog h2 { margin-bottom: 14px; font-size: 1.38rem; }
#post-dialog { width: min(calc(100% - 28px), 680px); }
#post-dialog > .section-title { padding-bottom: 12px; }
#post-dialog-title { margin: 0; }
#post-detail .post { padding: 12px 0 0; border-width: 1px 0 0; border-radius: 0; }
.field { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 650; }
.field input, .field textarea, .field select { min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid #cec5bd; border-radius: 6px; background: white; color: var(--ink); }
.field textarea { resize: vertical; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 17px; }
#form-error { color: #843e30; }
#notice { position: fixed; bottom: 18px; right: 18px; max-width: min(460px, calc(100% - 36px)); z-index: 2; background: var(--ink); color: white; padding: 10px 15px; border-radius: 8px; }

@media (max-width: 1150px) {
  .post-card .post-top { flex-wrap: wrap; }
  .post-card .post-top > div { flex: 1 0 100%; }
}

@media (max-width: 960px) {
  #ideas-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posts-grid { grid-template-columns: repeat(min(var(--post-columns), 3), minmax(0, 1fr)); }
  .post-card .caption { max-height: clamp(104px, 24dvh, 248px); }
}

@media (max-width: 560px) {
  .masthead { padding-inline: 12px; }
  .brand { flex: none; font-size: 0; gap: 0; }
  .workspace { flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
  .workspace a { white-space: nowrap; }
  #ideas-list { grid-template-columns: minmax(0, 1fr); }
  .has-posts { padding-inline: 8px; }
  .proposed-post { padding-inline: 0; }
  .feed-x { padding-inline: 12px; }
  .x-theme span { display: none; }
  .idea-preview { height: 195px; }
}

@media (max-width: 760px) {
  .masthead { gap: 10px; }
  .workspace { padding-left: 10px; }
  .local { display: none; }
  .layout { width: calc(100% - 24px); }
  .launch-toolbar { gap: 6px; }
  #launches { width: 100%; }
  .posts-grid { grid-template-columns: repeat(min(var(--post-columns), 2), minmax(0, 1fr)); }
  .post-card { padding-inline: 9px; }
}
