:root {
  --x-ink: #0f1419;
  --x-muted: #536471;
  --x-line: #cfd9de;
  --linkedin: #0a66c2;
  --linkedin-ink: rgba(0, 0, 0, .9);
  --linkedin-muted: rgba(0, 0, 0, .62);
  --network-line: #d9dfe3;
}

.platform-lanes,
.platform-lane {
  display: flex;
  flex-direction: column;
}

.platform-lanes { gap: 24px; }
.platform-lane { gap: 10px; min-width: 0; }

.platform-lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 30px;
}

.platform-lane-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-lane-header strong { font-size: 14px; }
.platform-lane-header > span { color: var(--muted); font-size: 12px; }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
  gap: 14px;
  align-items: start;
}

.platform-card {
  min-width: 0;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  container-type: inline-size;
}

.platform-card.is-thread,
.platform-card.has-carousel {
  grid-column: 1 / -1;
}

.platform-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  min-height: 50px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf8;
}

.platform-toolbar-main,
.platform-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.platform-toolbar-main { flex: 1 1 auto; }
.platform-toolbar-actions { flex: 0 0 auto; }

.platform-toolbar-main strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-meta {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.network-pill,
.connection-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.network-pill.x { background: var(--x-ink); color: white; }
.network-pill.linkedin { background: var(--linkedin); color: white; }
.network-pill.instagram { border: 1px solid #d7d1ca; background: white; color: #3d322c; }

.connection-pill {
  background: #fff3d9;
  color: #865300;
  font-weight: 700;
}

.platform-action {
  min-height: 30px;
  border: 1px solid #b9ada0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--body);
  padding: 5px 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.platform-action:hover { border-color: var(--green); color: var(--green-dark); }

.platform-action:focus-visible,
.media-open:focus-visible,
.media-dialog button:focus-visible,
.media-dialog a:focus-visible,
.carousel-button:focus-visible,
.carousel-dot:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.media-open {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  padding: 0;
  text-align: inherit;
}

.media-open img {
  display: block;
  width: 100%;
  max-width: 100%;
}

.media-zoom-label {
  position: absolute;
  inset: 9px 9px auto auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(15, 20, 25, .82);
  color: white;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transition: background-color 180ms cubic-bezier(.22, 1, .36, 1), transform 180ms cubic-bezier(.22, 1, .36, 1);
}

.media-zoom-label svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.media-open:hover .media-zoom-label {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.platform-preview {
  padding: clamp(10px, 2cqi, 18px);
  background: #f4f3f1;
}

.social-frame {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--network-line);
  border-radius: 12px;
  background: white;
}

.social-avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #171412;
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.social-avatar.brand { background: var(--green); }

.social-avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback { position: relative; z-index: 0; }

.social-avatar.small {
  width: 34px;
  height: 34px;
  font-size: 10px;
}

.social-text { overflow-wrap: anywhere; white-space: pre-line; }
.social-more { color: #595959; font-size: 14px; letter-spacing: 1px; }

.x-frame {
  padding: 14px 16px 8px;
  color: var(--x-ink);
  font-family: Arial, system-ui, sans-serif;
}

.x-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.x-avatar-rail {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.x-thread-line {
  width: 2px;
  flex: 1 1 auto;
  min-height: 24px;
  margin: 5px 0;
  background: var(--x-line);
}

.x-entry-body { min-width: 0; padding-bottom: 12px; }

.x-profile-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
}

.x-profile-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.verified-mark {
  display: inline-grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  border-radius: 50%;
  background: #1d9bf0;
  color: white;
  font-size: 9px;
  font-weight: 800;
}

.x-handle {
  overflow: hidden;
  color: var(--x-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-text {
  margin-top: 3px;
  color: var(--x-ink);
  font-size: 15px;
  line-height: 1.43;
}

.x-actions,
.linkedin-actions,
.instagram-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--x-muted);
}

.x-actions {
  max-width: 420px;
  margin-top: 10px;
  padding-right: 8px;
}

.social-icon {
  display: inline-grid;
  width: 30px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: currentColor;
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.x-media {
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--x-line);
  border-radius: 14px;
  background: #eff3f4;
}

.x-media > .media-open img {
  height: auto;
}

.x-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  aspect-ratio: 16 / 9;
  background: var(--x-line);
}

.x-media-grid.count-3 .media-open:first-child { grid-row: span 2; }

.x-media-grid .media-open {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.x-media-grid .media-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.linkedin-frame {
  color: var(--linkedin-ink);
  font-family: Arial, system-ui, sans-serif;
}

.linkedin-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px 0;
}

.linkedin-identity { min-width: 0; flex: 1 1 auto; }
.linkedin-identity strong, .linkedin-identity span { display: block; }
.linkedin-identity strong { font-size: 14px; }

.linkedin-identity span {
  overflow: hidden;
  color: var(--linkedin-muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linkedin-text {
  padding: 12px 16px 14px;
  font-size: 14px;
  line-height: 1.48;
}

.linkedin-media.media-single {
  width: 100%;
  overflow: hidden;
  background: #eef0f1;
}

.linkedin-media.media-single img {
  height: auto;
  object-fit: contain;
}

.linkedin-actions {
  gap: 4px;
  margin: 0 14px;
  padding: 7px 0 8px;
  border-top: 1px solid #e6e6e6;
}

.linkedin-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 6px 7px;
  color: var(--linkedin-muted);
  font-size: 11px;
  font-weight: 700;
}

.linkedin-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.social-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #eef0f1;
}

.carousel-track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  position: relative;
  display: grid;
  min-width: 100%;
  aspect-ratio: var(--slide-ratio, 16 / 9);
  place-items: center;
  scroll-snap-align: start;
  background: #eef0f1;
}

.carousel-slide .media-open {
  width: 100%;
  height: 100%;
}

.carousel-slide .media-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-controls {
  position: absolute;
  inset: 50% 10px auto;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}

.carousel-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 20, 20, .78);
  color: white;
  cursor: pointer;
  font-size: 18px;
  pointer-events: auto;
}

.carousel-dots {
  position: absolute;
  inset: auto 12px 10px auto;
  display: flex;
  gap: 5px;
  border-radius: 999px;
  background: rgba(20, 20, 20, .72);
  padding: 6px 8px;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .48);
  cursor: pointer;
  padding: 0;
}

.carousel-dot.is-active { background: white; }

.instagram-frame {
  max-width: 470px;
  color: #101010;
  font-family: Arial, system-ui, sans-serif;
}

.instagram-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 9px 12px;
}

.instagram-head strong { flex: 1 1 auto; font-size: 13px; }
.instagram-media.media-single img { height: auto; object-fit: contain; }
.instagram-actions { padding: 8px 10px 2px; color: #111; }
.instagram-action-group { display: flex; align-items: center; }

.instagram-caption {
  padding: 7px 12px 15px;
  font-size: 13px;
  line-height: 1.45;
}

.instagram-caption strong { margin-right: 4px; }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.asset-grid.count-1 { grid-template-columns: minmax(0, 1fr); }

.asset-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.asset-media { overflow: hidden; background: #eee9e2; }

.asset-media img {
  height: auto;
}

.asset-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  color: var(--muted);
  font-size: 10px;
}

.asset-card figcaption span:first-child {
  overflow: hidden;
  color: var(--body);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-caption {
  position: absolute;
  inset: auto auto 10px 10px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(31, 24, 21, .84);
  color: white;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
}

html.has-media-dialog { overflow: hidden; }

.media-dialog {
  width: min(96vw, 1380px);
  max-width: none;
  height: min(90vh, 900px);
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #151515;
  color: white;
  padding: 0;
}

.media-dialog::backdrop { background: rgba(15, 12, 10, .76); }
.media-dialog [hidden] { display: none !important; }

.media-dialog-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 350px);
  width: 100%;
  height: 100%;
}

.media-dialog-stage {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  background: #151515;
}

.media-dialog-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.media-dialog-close,
.media-dialog-navigation button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #171412;
  cursor: pointer;
}

.media-dialog-close {
  position: absolute;
  inset: 14px 14px auto auto;
  width: 40px;
  height: 40px;
  font-size: 25px;
  line-height: 1;
}

.media-dialog-navigation {
  position: absolute;
  inset: 50% 14px auto;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}

.media-dialog-navigation button {
  width: 42px;
  height: 42px;
  font-size: 25px;
  pointer-events: auto;
}

.media-dialog-navigation button[hidden] { display: none; }

.media-dialog-inspector {
  display: flex;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background: white;
  color: var(--ink);
  padding: 28px 24px 24px;
}

.media-dialog-context {
  display: block;
  margin-bottom: 7px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
}

.media-dialog-inspector h2 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 25px;
  letter-spacing: -.02em;
  line-height: 1.15;
  text-wrap: balance;
}

.media-dialog-meta {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.media-dialog-inspector > p {
  margin: auto 0 0;
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

.media-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.media-dialog-comment,
.media-dialog-review-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: white;
  cursor: pointer;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.media-dialog-comment:hover,
.media-dialog-review-link:hover { background: #05a356; }

/* Review calendar workspace */
.review-page .shell { max-width: 1480px; }

.review-page .week-navigation {
  margin-bottom: 14px;
  padding: 10px 0;
}

.review-page .week-navigation-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.review-page .week-navigation-head h2 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px;
  letter-spacing: -.02em;
}

.review-page .week-navigation-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.review-page .week-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.review-page .week-tab {
  position: relative;
  min-width: 0;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease-out, background-color 180ms ease-out, transform 180ms ease-out;
}

.review-page .week-tab:hover { border-color: #a99c8c; transform: translateY(-1px); }

.review-page .week-tab[aria-selected="true"] {
  border-color: var(--green);
  background: var(--mint);
}

.review-page .week-tab-date,
.review-page .week-tab-theme,
.review-page .week-tab-meta { display: block; }

.review-page .week-tab-date {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px;
  font-weight: 800;
}

.review-page .week-tab-theme {
  overflow: hidden;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-page .week-tab-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.review-page .week-tab .comment-count-dot {
  position: absolute;
  inset: 9px 9px auto auto;
  display: inline-grid;
  min-width: 20px;
  min-height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--body);
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
}

.review-page .day-panel {
  overflow: clip;
  border: 1px solid #c9bcad;
  border-radius: 14px;
  background: var(--surface);
}

.review-page .day-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.review-page .day-panel-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.review-page .day-panel-title strong {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
}

.review-page .day-panel-title span { color: var(--muted); font-size: 13px; }

.review-page .day-panel-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.review-page .review-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 20px;
  background: #fbfaf8;
}

.review-page .asset-panel,
.review-page .platform-panel { min-width: 0; }

.review-page .asset-panel {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-page .panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.review-page .panel-heading h3 {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px;
}

.review-page .panel-heading span { color: var(--muted); font-size: 11px; }

.review-page .asset-validity {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  border-radius: 10px;
  background: var(--mint);
  color: #27543a;
  padding: 9px 10px;
  font-size: 11px;
  line-height: 1.4;
}

.review-page .asset-validity::before {
  content: '✓';
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.review-page .platform-panel .platform-lanes { margin-top: 10px; }

.review-page .comments {
  border-top: 1px solid var(--line);
  padding: 20px;
}

@media (max-width: 1180px) {
  .review-page .week-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .review-page .review-layout { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .review-page .review-layout { grid-template-columns: minmax(0, 1fr); }
  .review-page .asset-panel { position: static; }
  .review-page .asset-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

@media (max-width: 620px) {
  .review-page .week-navigation-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .review-page .week-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-page .week-tab { min-height: 82px; }
  .review-page .day-panel-head { align-items: flex-start; flex-direction: column; }
  .review-page .day-panel-title { flex-direction: column; gap: 2px; }
  .review-page .day-panel-meta { justify-content: flex-start; }
  .review-page .review-layout, .review-page .comments { padding: 14px; }
}

@container (max-width: 520px) {
  .platform-toolbar { align-items: flex-start; flex-direction: column; }
  .platform-toolbar-actions { width: 100%; flex-wrap: wrap; }
  .platform-meta { margin-left: auto; }
}

@media (max-width: 700px) {
  .platform-lane-header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .platform-grid { grid-template-columns: minmax(0, 1fr); }
  .platform-card.is-thread, .platform-card.has-carousel { grid-column: auto; }
}

@media (max-width: 760px) {
  .media-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }
  .media-dialog-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .media-dialog-inspector {
    max-height: 220px;
    gap: 12px;
    padding: 16px;
  }
  .media-dialog-inspector h2 { font-size: 20px; }
  .media-dialog-inspector > p { margin-top: 0; font-size: 12px; }
  .media-dialog-actions { flex-direction: row; }
  .media-dialog-comment,
  .media-dialog-review-link { width: 100%; }
}

@media (max-width: 560px) {
  .platform-preview { padding: 8px; }
  .x-frame { padding-inline: 12px; }
  .x-profile-line { flex-wrap: wrap; }
  .x-handle:last-child { display: none; }
  .linkedin-action { gap: 3px; padding-inline: 3px; font-size: 10px; }
  .asset-grid { grid-template-columns: minmax(0, 1fr); }
  .media-zoom-label span { display: none; }
  .media-zoom-label { width: 30px; justify-content: center; padding-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track { scroll-behavior: auto; }
  .media-zoom-label { transition: none; }
}
