.sai-post-desk,
.sai-team-layout {
  --sai-workspace-edge: #293950;
  --sai-workspace-accent: #ffa76b;
  --sai-workspace-muted: #abbcd4;
  display: grid;
  grid-template-columns: minmax(235px, 320px) minmax(0, 1fr);
  min-width: 0;
  min-height: 500px;
  color: #edf3fd;
  background: #0c1525;
  border: 1px solid var(--sai-workspace-edge);
  border-radius: 20px;
}

.sai-post-rail,
.sai-team-rail {
  min-width: 0;
  padding: 1rem 0.75rem;
  background: radial-gradient(ellipse at 0 0, #332a46 0, transparent 50%), #111b2d;
  border-right: 1px solid var(--sai-workspace-edge);
  border-radius: 20px 0 0 20px;
}

.sai-post-rail > h3,
.sai-team-rail > h2 {
  margin: 0 0.45rem 0.9rem;
  font-size: 1rem;
}

.sai-post-desk .post-list,
.sai-team-list {
  display: grid;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sai-post-item { min-width: 0; }

.sai-post-choice,
.sai-team-person {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-width: 0;
  min-height: 68px;
  padding: 0.65rem;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
}

.sai-post-choice:hover,
.sai-team-person:hover { background: #202e46; }

.sai-post-choice[aria-pressed="true"],
.sai-team-person[aria-pressed="true"] {
  background: linear-gradient(115deg, #512f3d 0%, #272638 55%, #162743 100%);
  border-color: #a87b77;
  box-shadow: inset 3px 0 var(--sai-workspace-accent);
}

.sai-post-choice:focus-visible,
.sai-team-person:focus-visible,
.sai-team-detail :focus-visible,
.sai-post-detail :focus-visible {
  outline: 2px solid #ffc199;
  outline-offset: 2px;
}

.sai-post-choice .post-row-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.sai-post-summary,
.sai-team-person > span:last-child { display: grid; gap: 0.35rem; min-width: 0; }

.sai-post-summary strong,
.sai-team-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.sai-post-summary small,
.sai-team-person small {
  color: var(--sai-workspace-muted);
  font-size: 0.73rem;
  overflow-wrap: anywhere;
}

.sai-post-summary .fb-schedule-badge { justify-self: start; }
.sai-post-desk .fb-post-more { margin: 0.75rem 0.45rem 0; }

.sai-post-detail,
.sai-team-detail {
  min-width: 0;
  background: radial-gradient(ellipse at 100% 0, #25213e 0, transparent 48%);
  border-radius: 0 20px 20px 0;
}

.sai-post-placeholder,
.sai-team-placeholder {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 500px;
  padding: 2rem;
  text-align: center;
}

.sai-post-placeholder > span,
.sai-team-placeholder > span {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 18px;
  color: #ffd1a4;
  background: #33283d;
  border: 1px solid #5a4355;
  font-size: 1.45rem;
}

.sai-post-placeholder h3,
.sai-team-placeholder h3,
.sai-post-article h3 { margin: 0; }

.sai-post-placeholder p,
.sai-team-placeholder p { margin: 0.5rem 0 0; color: var(--sai-workspace-muted); }

.sai-post-article,
.sai-team-profile {
  display: grid;
  gap: 1.15rem;
  padding: clamp(1rem, 2.6vw, 1.8rem);
}

.sai-post-detail-head,
.sai-post-channel,
.sai-post-comments > header,
.sai-post-reply-target,
.sai-team-profile-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }

.sai-post-detail-head { justify-content: space-between; }
.sai-post-channel div { display: grid; gap: 0.25rem; }
.sai-post-channel span, .sai-comment-message time { font-size: 0.78rem; color: var(--sai-workspace-muted); }
.sai-post-back { display: none; }
.sai-post-body { display: grid; gap: 1rem; padding: 1rem; background: #182338; border: 1px solid #293950; border-radius: 17px; }
.sai-post-media {
  display: block;
  max-width: 100%;
  max-height: 380px;
  min-height: 0;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 11px;
}
.sai-post-message, .sai-comment-message p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.sai-post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.sai-post-actions .post-manage[open] { margin-bottom: 0.3rem; }
.sai-post-comments { display: grid; gap: 0.75rem; min-width: 0; }
.sai-post-comments h3 { font-size: 1rem; }
.sai-post-comments > header { justify-content: space-between; }
.sai-post-comment-status { margin: 0; color: var(--sai-workspace-muted); }
.sai-post-comment-status:empty, [data-reply-notice]:empty { display: none; }
.sai-post-comments > button { justify-self: start; }
.sai-post-comments [data-comment-list] { display: grid; gap: 0.75rem; }
.sai-comment-thread { display: grid; gap: 0.4rem; min-width: 0; }
.sai-comment-message { width: fit-content; max-width: 100%; padding: 0.65rem 0.9rem; border-radius: 6px 15px 15px; background: #1b2940; overflow-wrap: anywhere; }
.sai-comment-message p { margin-top: 0.28rem; }
.sai-comment-replies { display: grid; gap: 0.45rem; padding-left: 0.8rem; margin-left: 0.65rem; border-left: 2px solid #725e95; }
.sai-comment-replies .sai-comment-message { background: #29243e; }
.sai-comment-tools { display: flex; align-items: center; gap: 0.5rem; color: var(--sai-workspace-muted); }
.sai-post-reply { display: grid; gap: 0.6rem; margin-top: 0.3rem; padding: 0.85rem; border: 1px solid #715975; border-radius: 14px; background: #172034; }
.sai-post-reply[hidden], .sai-post-desk button[hidden] { display: none; }
.sai-post-reply-target { justify-content: space-between; }
.sai-post-reply-fields { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.55rem; }
.sai-post-reply textarea { flex: 1 1 220px; min-width: 0; width: 100%; resize: vertical; color: inherit; background: #10192b; border: 1px solid #495370; padding: 0.65rem; border-radius: 9px; font: inherit; }

.sai-team-layout { grid-template-columns: minmax(220px, 295px) minmax(0, 1fr); }
.sai-team-rail { background: radial-gradient(ellipse at 0 0, #303150 0, transparent 65%), #121c2e; }
.sai-team-rail > p, .sai-team-rail nav { margin: 0.8rem 0.45rem 0; color: var(--sai-workspace-muted); }
.sai-team-rail nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem; }
.sai-team-person .avatar { flex: 0 0 36px; width: 36px; height: 36px; }
.sai-team-profile-head {
  padding: 1rem;
  border: 1px solid #3e4059;
  border-radius: 16px;
  background: radial-gradient(ellipse at 0 100%, #322740, transparent 65%), #1b2337;
}
.sai-team-profile-head .avatar { flex: 0 0 66px; width: 66px; height: 66px; }
.sai-team-profile-head h2 { margin: 0; overflow-wrap: anywhere; }
.sai-team-profile-head p { margin: 0.2rem 0 0; color: var(--sai-workspace-muted); overflow-wrap: anywhere; }
.sai-team-profile form, .sai-team-access { min-width: 0; padding: 1rem; border: 1px solid #303d56; border-radius: 14px; background: #111b2d; }
.sai-team-profile form h3 { margin: 0 0 0.8rem; }
.sai-team-profile form p { margin: 0.45rem 0 0; }
.sai-team-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.sai-team-profile .sai-permission-toggle { margin: 0; }
.sai-team-profile [role="status"]:empty { display: none; }
.sai-team-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin-bottom: 0.85rem; }
.sai-team-photo label { cursor: pointer; }
.sai-team-photo input:focus-visible + label { outline: 2px solid #ffc199; }
.sai-team-photo input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 760px) {
  .sai-post-desk, .sai-team-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .sai-post-desk:not(.has-selection) .sai-post-detail { display: none; }
  .sai-post-desk.has-selection .sai-post-rail { display: none; }
  .sai-post-desk.has-selection .sai-post-back { display: inline-flex; }
  .sai-post-rail, .sai-team-rail { border-right: 0; border-radius: 20px 20px 0 0; }
  .sai-team-rail { border-bottom: 1px solid var(--sai-workspace-edge); }
  .sai-post-detail, .sai-team-detail { border-radius: 20px; }
  .sai-team-placeholder { min-height: 185px; }
  .sai-team-fields { grid-template-columns: minmax(0, 1fr); }
}
