:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #0f1419;
  --ink-soft: #536471;
  --ink-faint: #8b98a5;
  --border: #eff3f4;
  --border-strong: #cfd9de;
  --accent: #1d9bf0;
  --danger: #f4212e;

  --sidebar-w: 300px;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 20, 25, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

/* ---------- Editor sidebar (floating overlay, theme-aware) ---------- */

.sidebar {
  background: var(--sb-bg, rgba(255, 255, 255, 0.82));
  color: var(--sb-ink, var(--ink));
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--sb-border, rgba(15, 20, 25, 0.08));
  border-radius: 16px;
  padding: 18px 16px;
  overflow-y: auto;
  width: var(--sidebar-w);
  height: calc(100vh - 32px);
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
  box-shadow: 0 12px 40px rgba(15, 20, 25, 0.18), 0 2px 6px rgba(15, 20, 25, 0.08);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
body.editor-collapsed .sidebar:not(.sidebar-right) {
  transform: translateX(calc(-100% - 20px));
}
body.media-collapsed .sidebar-right {
  transform: translateX(calc(100% + 20px));
}

/* Collapse toggle inside sidebar header */
.sidebar-collapse {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--sb-soft, var(--ink-faint));
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: background 120ms ease, color 120ms ease;
}
.sidebar-collapse:hover {
  background: var(--sb-seg-bg, #eef1f4);
  color: var(--sb-ink, var(--ink));
}

/* Reveal pills — appear when sidebar is collapsed */
.sidebar-reveal {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 101;
  width: 22px;
  height: 48px;
  background: var(--sb-bg, rgba(255, 255, 255, 0.82));
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--sb-border, rgba(15, 20, 25, 0.08));
  box-shadow: 0 4px 16px rgba(15, 20, 25, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sb-soft, var(--ink-faint));
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, color 120ms ease, background 160ms ease, border-color 160ms ease;
}
.sidebar-reveal:hover { color: var(--sb-ink, var(--ink)); }
.sidebar-reveal-left  { left: 0;  border-radius: 0 10px 10px 0; }
.sidebar-reveal-right { right: 0; border-radius: 10px 0 0 10px; }
body.editor-collapsed .sidebar-reveal-left  { opacity: 1; pointer-events: auto; }
body.media-collapsed  .sidebar-reveal-right { opacity: 1; pointer-events: auto; }
.sidebar .field input,
.sidebar .field textarea,
.sidebar .post-text,
.sidebar .inline input {
  background: var(--sb-input-bg, #fff);
  border-color: var(--sb-input-border, var(--border-strong));
  color: var(--sb-ink, var(--ink));
}
.sidebar .segmented { background: var(--sb-seg-bg, #eef1f4); }
.sidebar .seg.active, .sidebar .seg-vp.active { background: var(--sb-seg-active, #fff); color: var(--sb-ink, var(--ink)); }
.sidebar .post-item { background: var(--sb-item-bg, #fafbfc); border-color: var(--sb-input-border, var(--border)); }
.sidebar .panel h2,
.sidebar .sidebar-header .muted,
.sidebar .hint,
.sidebar .inline > span,
.sidebar .field > span { color: var(--sb-soft, var(--ink-faint)); }
.sidebar .btn.ghost { color: var(--sb-soft, var(--ink-soft)); border-color: var(--sb-input-border, var(--border-strong)); }
.sidebar .btn { background: var(--sb-btn, var(--ink)); color: var(--sb-btn-ink, #fff); }
.sidebar .drag-handle:hover { background: var(--sb-seg-bg, #eef1f4); color: var(--sb-ink, var(--ink)); }

body.preview-dark {
  background: #000;
  --sb-bg: rgba(22, 24, 28, 0.82);
  --sb-ink: #e7e9ea;
  --sb-soft: #9ba3ac;
  --sb-border: rgba(255, 255, 255, 0.1);
  --sb-input-bg: rgba(255, 255, 255, 0.06);
  --sb-input-border: rgba(255, 255, 255, 0.14);
  --sb-seg-bg: rgba(255, 255, 255, 0.06);
  --sb-seg-active: rgba(255, 255, 255, 0.14);
  --sb-item-bg: rgba(255, 255, 255, 0.04);
  --sb-btn: #fff;
  --sb-btn-ink: #0f1419;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.sidebar-header h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}
.sidebar-header h1 span { color: var(--accent); }
.sidebar-header .muted { margin: 2px 0 0; color: var(--ink-faint); font-size: 12px; }

.panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hint { font-size: 12px; color: var(--ink-faint); margin: 0; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--ink-soft); }
.field input,
.field textarea,
.post-text,
.inline input {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
}
.field input:focus,
.field textarea:focus,
.post-text:focus,
.inline input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.15);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.toggle { cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .switch {
  width: 34px; height: 20px;
  background: #dbe3ea;
  border-radius: 999px;
  position: relative;
  transition: background 140ms ease;
  flex-shrink: 0;
}
.toggle .switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 140ms ease;
}
.toggle input:checked ~ .switch { background: var(--accent); }
.toggle input:checked ~ .switch::after { transform: translateX(14px); }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 3px;
  background: #eef1f4;
  border-radius: 10px;
}
.seg, .vp-btn {
  border: 0;
  background: transparent;
  padding: 7px 8px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.seg.active, .vp-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.avatar-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.avatar-preview {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #794bc4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 150ms;
}
.avatar-preview[data-drop-hover="1"] { outline-color: #1d9bf0; }
.avatar-inputs { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.cover-preview-strip {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0ea5e9, #a78bfa) center/cover;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  position: relative;
  margin-bottom: 6px;
  border: 1.5px dashed rgba(0,0,0,0.15);
  transition: border-color 150ms;
}
.cover-preview-strip::after {
  content: "Drop banner image here";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms;
}
.cover-preview-strip:not(.has-cover)::after { opacity: 1; }
.cover-preview-strip[data-drop-hover="1"] { border-color: #0a66c2; border-style: solid; }

.btn {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 80ms ease, opacity 120ms ease;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border-strong);
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-item {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  grid-template-columns: 20px 1fr 24px;
  gap: 8px;
  align-items: start;
  transition: box-shadow 120ms ease, transform 120ms ease, opacity 120ms ease, border-color 120ms ease;
}
.post-item.dragging { opacity: 0.5; box-shadow: var(--shadow-md); }
.post-item.drag-over { border-color: var(--accent); }
.drag-handle, .delete-post {
  border: 0;
  background: transparent;
  color: var(--sb-soft, var(--ink-faint));
  cursor: grab;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drag-handle:hover { color: var(--sb-ink, var(--ink)); background: var(--sb-seg-bg, #eef1f4); }
.delete-post { cursor: pointer; }
.delete-post:hover { color: var(--danger); background: rgba(244, 33, 46, 0.12); }

.post-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; grid-column: 1 / -1; }
.post-details { display: flex; flex-direction: column; gap: 6px; }
.post-item.collapsed .post-details { display: none; }
.post-toggle {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--sb-soft, var(--ink-faint));
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 4px 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
}
.post-toggle:hover { color: var(--sb-ink, var(--ink)); }
.post-toggle .chev { transition: transform 140ms ease; }
.post-item:not(.collapsed) .post-toggle .chev { transform: rotate(180deg); }
.post-item:not(.collapsed) .post-toggle .toggle-label::after { content: ""; }
.post-item.collapsed .post-text { display: none; }
.post-text {
  resize: vertical;
  min-height: 48px;
  line-height: 1.45;
  font-family: inherit;
}
.post-meta { display: grid; grid-template-columns: 70px 1fr; gap: 6px; }
.post-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.inline { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.inline > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.inline input { font-size: 12px; padding: 6px 8px; }
.inline.tiny input { padding: 5px 6px; text-align: center; }

.sidebar-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--sb-input-border, var(--border)); }

/* ---------- Media library (right-side floating sidebar) ---------- */

.sidebar-right {
  left: auto;
  right: 16px;
}

.media-drop {
  position: relative;
  border: 2px dashed var(--sb-input-border, var(--border-strong));
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  background: var(--sb-item-bg, #fafbfc);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.media-drop:hover,
.media-drop.is-over {
  border-color: var(--accent);
  background: rgba(29, 155, 240, 0.08);
}
.media-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--sb-soft, var(--ink-faint));
  font-size: 12px;
  pointer-events: none;
}
.media-drop-inner svg {
  width: 22px; height: 22px;
}
.media-link {
  pointer-events: auto;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.media-empty {
  font-size: 12px;
  color: var(--sb-soft, var(--ink-faint));
  margin: 0;
  text-align: center;
  padding: 4px 0 2px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.media-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sb-item-bg, #eef1f4);
  border: 1px solid var(--sb-input-border, var(--border));
  cursor: grab;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.media-thumb:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.media-thumb:active { cursor: grabbing; }
.media-thumb.dragging { opacity: 0.4; }
.media-thumb.armed {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.35);
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.media-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 20px; height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
  font-size: 14px;
  line-height: 1;
}
.media-thumb:hover .media-remove { opacity: 1; }
.media-remove:hover { background: rgba(244, 33, 46, 0.9); }

/* Armed mode: nudge that canvas targets are click-to-drop */
body.media-armed [data-post-id],
body.media-armed [data-cover-target],
body.media-armed [data-avatar-target] { cursor: copy; }
body.media-armed [data-post-id]:hover,
body.media-armed [data-cover-target]:hover,
body.media-armed [data-avatar-target]:hover {
  outline: 2px solid rgba(29, 155, 240, 0.55);
  outline-offset: -2px;
}

/* Sidebar post hover/expand mirror: highlight the same feed post with the
   same outline styling used for drag/drop targeting. */
[data-post-id][data-sidebar-active="1"] {
  outline: 2px solid rgba(29, 155, 240, 0.55);
  outline-offset: -2px;
}

/* ---------- Stage ---------- */

.stage {
  overflow-y: auto;
  height: 100vh;
  position: relative;
}
.stage-inner { min-height: 100%; }

/* Floating viewport dock */
.vp-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  /* styling adapts to underlying theme */
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: rgba(20, 22, 26, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9999px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  z-index: 50;
}
.vp-btn {
  width: 36px;
  height: 32px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.55);
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}
.vp-btn:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.06); }
.vp-btn.active {
  background: #fff;
  color: #0f1419;
}
.vp-divider {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.2);
  margin: 0 2px;
  align-self: center;
  flex-shrink: 0;
}
body.focus-mode #toggleFocus { background: #fff; color: #0f1419; }



/* ==================================================
   X (Twitter) full-page
   ================================================== */

.x-page {
  --x-bg: #000;
  --x-ink: #e7e9ea;
  --x-soft: #71767b;
  --x-border: #2f3336;
  --x-hover: rgba(231,233,234,0.03);
  --x-hover-strong: rgba(231,233,234,0.1);
  --x-accent: #1d9bf0;
  --x-like: #f91880;
  --x-retweet: #00ba7c;

  background: var(--x-bg);
  color: var(--x-ink);
  min-height: 100%;
  font-size: 15px;
  display: grid;
  grid-template-columns: minmax(88px, 275px) minmax(0, 600px) minmax(290px, 350px);
  justify-content: center;
  gap: 0;
}
.x-page.force-light {
  --x-bg: #fff;
  --x-ink: #0f1419;
  --x-soft: #536471;
  --x-border: #eff3f4;
  --x-hover: rgba(15,20,25,0.03);
  --x-hover-strong: rgba(15,20,25,0.1);
}

/* Left nav */
.x-nav {
  padding: 4px 8px;
  border-right: 1px solid var(--x-border);
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.x-logo {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--x-ink);
  margin: 2px 0;
  cursor: pointer;
  transition: background 120ms ease;
}
.x-logo:hover { background: var(--x-hover-strong); }
.x-logo svg { width: 28px; height: 28px; }

.x-nav-items { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.x-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 12px;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 400;
  color: var(--x-ink);
  transition: background 120ms ease;
  max-width: max-content;
}
.x-nav-item:hover { background: var(--x-hover-strong); }
.x-nav-item.active { font-weight: 700; }
.x-nav-item svg { width: 26px; height: 26px; flex-shrink: 0; }

.x-post-btn {
  margin: 16px 8px 0;
  background: var(--x-ink);
  color: var(--x-bg);
  border: 0;
  border-radius: 9999px;
  padding: 15px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: opacity 120ms ease;
}
.x-post-btn:hover { opacity: 0.9; }

.x-profile {
  margin-top: auto;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 120ms ease;
}
.x-profile:hover { background: var(--x-hover-strong); }
.x-profile .av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #794bc4);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.x-profile .info { line-height: 1.2; min-width: 0; flex: 1; }
.x-profile .info .n {
  font-weight: 700;
  color: var(--x-ink);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-profile .info .h { color: var(--x-soft); font-size: 14px; }
.x-profile .dots { color: var(--x-ink); }

/* Center feed */
.x-feed {
  border-right: 1px solid var(--x-border);
  min-width: 0;
}
.x-tabs {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--x-bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid var(--x-border);
  z-index: 2;
}
.x-tab {
  padding: 16px;
  text-align: center;
  cursor: pointer;
  color: var(--x-soft);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  transition: background 120ms ease;
}
.x-tab:hover { background: var(--x-hover-strong); }
.x-tab.active { color: var(--x-ink); font-weight: 700; }
.x-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 4px;
  background: var(--x-accent);
  border-radius: 4px;
}

.x-composer {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--x-border);
}
.x-composer .av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #794bc4);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.x-composer .body { padding-top: 10px; }
.x-composer .placeholder {
  color: var(--x-soft);
  font-size: 20px;
  padding: 4px 0 12px;
}
.x-composer .cmp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 10px;
}
.x-composer .cmp-icons {
  display: inline-flex;
  gap: 2px;
  color: var(--x-accent);
}
.x-composer .cmp-icons .ic {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease;
}
.x-composer .cmp-icons .ic:hover { background: rgba(29,155,240,0.1); }
.x-composer .cmp-icons .ic.muted { color: var(--x-soft); opacity: 0.4; }
.x-composer .cmp-icons .ic svg { width: 18px; height: 18px; }
.x-composer .cmp-post {
  background: var(--x-accent);
  color: #fff;
  border: 0;
  border-radius: 9999px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.5;
}

.tweet {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--x-border);
  cursor: pointer;
  transition: background 120ms ease;
}
.tweet:hover { background: var(--x-hover); }
.tweet .avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d9bf0, #794bc4);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.tweet .body { min-width: 0; }
.tweet .head {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}
.tweet .name {
  font-weight: 700;
  color: var(--x-ink);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tweet .verified { display: inline-flex; color: var(--x-accent); flex-shrink: 0; }
.tweet .handle, .tweet .dot, .tweet .time { color: var(--x-soft); }
.tweet .more {
  margin-left: auto;
  color: var(--x-soft);
  padding: 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tweet .more svg { width: 18px; height: 18px; }
.tweet .content {
  margin-top: 2px;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.3125;
  color: var(--x-ink);
}
.tweet .content a { color: var(--x-accent); text-decoration: none; }

.tweet .media {
  margin-top: 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--x-border);
  position: relative;
  max-height: 680px;
  background: #0a0a0a;
}
.tweet .media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 680px;
  object-fit: contain;
}

.tweet .actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto auto;
  max-width: 460px;
  color: var(--x-soft);
  font-size: 13px;
}
.tweet .act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 120ms ease;
}
.tweet .act svg { width: 18px; height: 18px; }
.tweet .act.reply:hover { color: var(--x-accent); }
.tweet .act.repost:hover { color: var(--x-retweet); }
.tweet .act.like:hover { color: var(--x-like); }
.tweet .act.views:hover, .tweet .act.share:hover, .tweet .act.bookmark:hover { color: var(--x-accent); }

/* Right column */
.x-right {
  padding: 4px 16px 32px 32px;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
}
.x-search {
  position: sticky;
  top: 0;
  background: var(--x-bg);
  padding: 4px 0 12px;
  z-index: 1;
}
.x-search input {
  width: 100%;
  background: #202327;
  border: 1px solid transparent;
  color: var(--x-ink);
  border-radius: 9999px;
  padding: 12px 16px 12px 44px;
  font: inherit;
  outline: none;
}
.x-page.force-light .x-search input { background: #eff3f4; }
.x-search {
  position: sticky;
  top: 0;
}
.x-search-wrap {
  position: relative;
}
.x-search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--x-soft);
  width: 18px;
  height: 18px;
}

.x-card {
  background: #16181c;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: var(--x-ink);
}
.x-page.force-light .x-card { background: #f7f9f9; }
.x-card h3 {
  margin: 4px 0 10px;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.x-card h3 .close { color: var(--x-soft); font-weight: 400; cursor: pointer; }
.x-card .x-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--x-border);
  cursor: pointer;
}
.x-card .x-item:last-child { border-bottom: 0; }
.x-card .x-item .meta {
  font-size: 13px;
  color: var(--x-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.x-card .x-item .meta .av-badge {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #333;
}
.x-card .x-item .t { font-weight: 700; line-height: 1.3; font-size: 15px; }
.x-card .x-item .c {
  font-size: 13px;
  color: var(--x-soft);
  margin-top: 2px;
}

.x-premium { text-align: left; }
.x-premium p { color: var(--x-soft); margin: 0 0 12px; font-size: 15px; }
.x-premium .btn {
  background: var(--x-accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 9999px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.x-trend {
  padding: 12px 0;
  border-bottom: 1px solid var(--x-border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.x-trend:last-child { border-bottom: 0; }
.x-trend .tc { font-size: 13px; color: var(--x-soft); }
.x-trend .tt { font-weight: 700; font-size: 15px; margin-top: 1px; }
.x-trend .dots { color: var(--x-soft); }

.x-follow {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
}
.x-follow .av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #333;
}
.x-follow .n { font-weight: 700; font-size: 15px; }
.x-follow .h { color: var(--x-soft); font-size: 14px; }
.x-follow .btn {
  background: var(--x-ink);
  color: var(--x-bg);
  padding: 6px 16px;
  font-weight: 700;
  border: 0;
  border-radius: 9999px;
  font-size: 14px;
  cursor: pointer;
}

.x-legal {
  padding: 8px 4px 16px;
  font-size: 13px;
  color: var(--x-soft);
  line-height: 1.4;
}
.x-legal a { color: inherit; text-decoration: none; margin-right: 12px; }

/* ==================================================
   LinkedIn full-page
   ================================================== */

.li-page {
  --li-bg: #f4f2ee;
  --li-card: #ffffff;
  --li-ink: rgba(0,0,0,0.9);
  --li-soft: rgba(0,0,0,0.6);
  --li-faint: rgba(0,0,0,0.45);
  --li-border: #e0dfdc;
  --li-hover: #f3f2ef;
  --li-accent: #0a66c2;

  background: var(--li-bg);
  min-height: 100%;
  font-size: 14px;
  color: var(--li-ink);
}
.li-page.force-dark {
  --li-bg: #1b1f23;
  --li-card: #1d2226;
  --li-ink: rgba(255,255,255,0.9);
  --li-soft: rgba(255,255,255,0.6);
  --li-faint: rgba(255,255,255,0.4);
  --li-border: #38434f;
  --li-hover: #2a2f36;
}

.li-header {
  background: var(--li-card);
  border-bottom: 1px solid var(--li-border);
  position: sticky;
  top: 0;
  z-index: 5;
  height: 52px;
}
.li-header-inner {
  max-width: 1128px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.li-logo {
  width: 34px; height: 34px;
  background: #0a66c2;
  border-radius: 4px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.li-search {
  width: 280px;
  height: 34px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--li-hover) 85%, #8fb5d6 15%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--li-soft);
  flex-shrink: 0;
}
.li-search svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.li-search input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--li-ink);
  font-size: 14px;
}
.li-search input::placeholder {
  color: var(--li-soft);
}

.li-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
}
.li-nav-item {
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--li-soft);
  font-size: 12px;
  cursor: pointer;
  position: relative;
  min-width: 52px;
  height: 52px;
  justify-content: center;
  border-bottom: 2px solid transparent;
}
.li-nav-item:hover { color: var(--li-ink); }
.li-nav-item.active {
  color: var(--li-ink);
  border-bottom-color: var(--li-ink);
}
.li-nav-item svg { width: 24px; height: 24px; }
.li-nav-item .dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #cb112d;
}
.li-nav-item .bg {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #cb112d;
  color: #fff;
  font-size: 10px;
  min-width: 14px;
  height: 14px;
  border-radius: 9px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.li-nav-item .me {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  aspect-ratio: 1 / 1;
  border-radius: 9999px;
  overflow: hidden;
  background: linear-gradient(135deg, #0a66c2, #0ea5e9);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1.5px solid var(--li-border);
}
.li-nav-me { border-left: 1px solid var(--li-border); margin-left: 4px; }

.li-main {
  display: grid;
  grid-template-columns: 225px minmax(0, 540px) 300px;
  gap: 24px;
  max-width: 1128px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

/* Left profile card */
.li-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 76px;
  align-self: start;
}
.li-profile-card {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  overflow: hidden;
}
.li-cover {
  height: 54px;
  background: linear-gradient(135deg, #0ea5e9, #a78bfa);
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  transition: box-shadow 140ms ease, transform 140ms ease;
}
.li-cover:hover {
  box-shadow: inset 0 0 0 2px rgba(29, 155, 240, 0.35);
}
.li-cover[data-drop-hover="1"]::after {
  content: "Drop cover image";
  position: absolute;
  inset: 0;
  background: rgba(10, 102, 194, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.li-cover[data-paste-active="1"]::before {
  content: "⌘V to paste";
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(10, 102, 194, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9999px;
  pointer-events: none;
}
.cover-clear {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.li-cover:hover .cover-clear { opacity: 1; }
.li-cover .premium-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  color: #f8c77e;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.li-avatar-wrap {
  padding: 0 12px;
  margin-top: -30px;
  position: relative;
  z-index: 2;
}
.li-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid var(--li-card);
  background: linear-gradient(135deg, #0a66c2, #0ea5e9);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  cursor: copy;
  transition: box-shadow 140ms ease, transform 140ms ease;
}
.li-avatar:hover {
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.25);
  transform: translateY(-1px);
}
.li-avatar[data-drop-hover="1"] {
  outline: 2px solid rgba(29, 155, 240, 0.75);
  outline-offset: 2px;
}
.li-profile-body {
  padding: 8px 12px 12px;
}
.li-profile-body .n {
  font-weight: 600;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.li-profile-body .premium-dot {
  display: inline-flex;
  background: linear-gradient(135deg, #f8c77e, #d89a4e);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}
.li-profile-body .hl { color: var(--li-soft); font-size: 13px; margin-top: 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li-profile-body .loc { color: var(--li-faint); font-size: 12px; margin-top: 6px; }
.li-profile-body .org {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--li-border);
  font-size: 12px;
  color: var(--li-soft);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.li-profile-body .org::before {
  content: "";
  width: 20px; height: 20px;
  background: #0a66c2;
  border-radius: 4px;
  display: inline-block;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3 21h18M3 10h18M5 6l7-3 7 3M4 10v11M20 10v11M8 14v3M12 14v3M16 14v3'/></svg>");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center;
}

.li-stats {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  padding: 8px 0;
  font-size: 12px;
}
.li-stats .st {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  cursor: pointer;
}
.li-stats .st:hover { background: var(--li-hover); }
.li-stats .st .k { color: var(--li-soft); }
.li-stats .st .v { color: var(--li-accent); font-weight: 600; }
.li-stats .prem {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--li-border);
  margin-top: 6px;
  color: var(--li-soft);
  font-weight: 600;
  cursor: pointer;
}
.li-stats .prem::before {
  content: "";
  width: 14px; height: 14px;
  background: linear-gradient(135deg, #f8c77e, #d89a4e);
  display: inline-block;
}

.li-pages {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
}
.li-pages h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--li-soft); }
.li-pages .pg {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 6px 0;
  align-items: center;
}
.li-pages .pg .lg {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: #fafafa;
  border: 1px solid var(--li-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--li-ink);
  font-weight: 700;
}
.li-pages .pg .nm { font-weight: 600; font-size: 13px; }
.li-pages .pg .ac { color: var(--li-faint); font-size: 11px; }

.li-links {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  padding: 8px 0;
}
.li-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--li-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.li-links a:hover { background: var(--li-hover); color: var(--li-ink); }
.li-links a svg { width: 18px; height: 18px; }

/* Center feed */
.li-feed { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.li-composer {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  padding: 12px 16px;
}
.li-composer-top {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  align-items: center;
}
.li-composer-top .av {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a66c2, #0ea5e9);
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.li-composer-top .placeholder {
  border: 1px solid var(--li-border);
  border-radius: 9999px;
  padding: 12px 16px;
  color: var(--li-soft);
  cursor: pointer;
  font-weight: 600;
}
.li-composer-top .placeholder:hover { background: var(--li-hover); }
.li-composer-bot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.li-composer-bot button {
  border: 0;
  background: transparent;
  color: var(--li-soft);
  font-weight: 600;
  font-size: 14px;
  padding: 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.li-composer-bot button:hover { background: var(--li-hover); }
.li-composer-bot button svg { width: 20px; height: 20px; }
.li-composer-bot .video svg { color: #e7a33e; }
.li-composer-bot .photo svg { color: #378fe9; }
.li-composer-bot .article svg { color: #e06847; }

.li-sort {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--li-soft);
  font-size: 12px;
  padding: 4px 0 2px;
  gap: 4px;
}
.li-sort b { color: var(--li-ink); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }

.li-post {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  color: var(--li-ink);
}
.li-post-head {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  padding: 12px 16px 8px;
  align-items: flex-start;
}
.li-post-head .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a66c2, #0ea5e9);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  background-size: cover;
  background-position: center;
}
.li-post-head .who { min-width: 0; line-height: 1.2; }
.li-post-head .name-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--li-ink);
  font-size: 14px;
}
.li-post-head .name-row .degree {
  color: var(--li-faint);
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}
.li-post-head .headline {
  color: var(--li-soft);
  font-size: 12px;
  margin-top: 1px;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.li-post-head .followers {
  color: var(--li-faint);
  font-size: 12px;
}
.li-post-head .meta {
  color: var(--li-faint);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
}
.li-post-head .actions-top {
  display: inline-flex;
  gap: 4px;
  color: var(--li-soft);
}
.li-post-head .actions-top button {
  border: 0; background: transparent; color: inherit;
  padding: 6px; border-radius: 50%; cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.li-post-head .actions-top button:hover { background: var(--li-hover); }

.li-post-body {
  padding: 0 16px 8px;
  white-space: pre-wrap;
  line-height: 1.45;
  color: var(--li-ink);
  font-size: 14px;
}
.li-post-body .see-more { color: var(--li-faint); cursor: pointer; }

.li-post-media {
  position: relative;
  background: #000;
  border-top: 1px solid var(--li-border);
  border-bottom: 1px solid var(--li-border);
  max-height: 720px;
  overflow: hidden;
}
.li-post-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: contain;
}

.li-reactions {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--li-faint);
  font-size: 12px;
}
.li-reactions .bubbles {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.li-reactions .bubble {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--li-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  margin-left: -4px;
}
.li-reactions .bubble:first-child { margin-left: 0; }
.li-reactions .bubble.b-like { background: #378fe9; }
.li-reactions .bubble.b-celebrate { background: #6dae4f; }
.li-reactions .bubble.b-love { background: #df704d; }
.li-reactions .bubbles .count { margin-left: 6px; }

.li-post-stats {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--li-faint);
  font-size: 12px;
}
.li-post-stats span + span::before {
  content: "·";
  margin-right: 8px;
}

.li-actions {
  border-top: 1px solid var(--li-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px 8px;
}
.li-actions button {
  border: 0;
  background: transparent;
  color: var(--li-soft);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 4px;
  cursor: pointer;
}
.li-actions button:hover { background: var(--li-hover); }
.li-actions button svg { width: 20px; height: 20px; }

/* Right column */
.li-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}

.li-news {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  padding: 12px 16px 8px;
}
.li-news h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.li-news .top { color: var(--li-faint); font-size: 12px; margin: 0 0 8px; }
.li-news .story {
  padding: 6px 0;
  cursor: pointer;
}
.li-news .story .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.li-news .story .m { color: var(--li-faint); font-size: 12px; margin-top: 2px; }
.li-news .more {
  color: var(--li-soft);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 0;
  cursor: pointer;
}

.li-games {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  padding: 12px 16px;
}
.li-games h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.li-games .g {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}
.li-games .g .ico {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: #eee;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.li-games .g .nm { font-weight: 600; font-size: 13px; }
.li-games .g .sub { color: var(--li-faint); font-size: 12px; }
.li-games .g .chev { color: var(--li-faint); }

.li-ad {
  background: var(--li-card);
  border: 1px solid var(--li-border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  color: var(--li-soft);
}
.li-ad .label { color: var(--li-faint); font-size: 11px; margin-bottom: 6px; }
.li-ad .brand {
  width: 48px; height: 48px;
  background: #f4212e;
  color: #fff;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  margin-bottom: 8px;
}
.li-ad .title { font-weight: 600; font-size: 14px; color: var(--li-ink); }
.li-ad .follow {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid var(--li-accent);
  color: var(--li-accent);
  background: transparent;
  border-radius: 9999px;
  font-weight: 600;
  cursor: pointer;
}

.li-footer {
  padding: 8px 4px;
  color: var(--li-faint);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.li-footer a { color: inherit; text-decoration: none; }

/* ---------- Image drop targets ---------- */

.tweet, .li-post { position: relative; }

.tweet[data-paste-active="1"]::before,
.li-post[data-paste-active="1"]::before {
  content: "⌘V to paste image";
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(29, 155, 240, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  animation: pasteHintFade 180ms ease forwards;
}
.li-post[data-paste-active="1"]::before { background: rgba(10, 102, 194, 0.9); }
@keyframes pasteHintFade { to { opacity: 1; } }

.tweet[data-paste-flash="1"],
.li-post[data-paste-flash="1"] {
  animation: pasteFlash 500ms ease;
}
@keyframes pasteFlash {
  0% { box-shadow: inset 0 0 0 2px rgba(29, 155, 240, 0.8); }
  100% { box-shadow: inset 0 0 0 0 transparent; }
}

.tweet[data-drop-hover="1"]::after,
.li-post[data-drop-hover="1"]::after {
  content: "Drop image here";
  position: absolute;
  inset: 6px;
  border: 2px dashed var(--x-accent, #1d9bf0);
  border-radius: 14px;
  background: rgba(29, 155, 240, 0.12);
  color: var(--x-accent, #1d9bf0);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}
.li-post[data-drop-hover="1"]::after {
  border-color: #0a66c2;
  color: #0a66c2;
  background: rgba(10, 102, 194, 0.12);
}

/* LinkedIn carousel */
.li-carousel {
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
  background: var(--li-hover, #f3f2ef);
  border: 1px solid var(--li-border);
}
.li-carousel-track { line-height: 0; }
.li-carousel-img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #000;
  display: block;
}
.li-carousel-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--li-card);
  border-top: 1px solid var(--li-border);
}
.li-carousel-btn {
  border: 0;
  background: transparent;
  color: var(--li-soft);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}
.li-carousel-btn:hover:not(:disabled) { background: var(--li-hover); color: var(--li-ink); }
.li-carousel-btn:disabled { opacity: 0.3; cursor: default; }
.li-carousel-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--li-ink);
  min-width: 48px;
  text-align: center;
}

/* PDF / Video badges on media thumbnails */
.media-pdf-badge, .media-video-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  pointer-events: none;
  letter-spacing: 0.02em;
}
.media-video-badge { background: rgba(220,38,38,0.85); }
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Video in posts */
.media video, .li-post-media video, .ig-post-image-wrap video {
  width: 100%;
  max-height: 500px;
  display: block;
  background: #000;
}

/* Inline text editing on canvas */
.tweet[data-post-id] .content,
.li-post[data-post-id] .li-post-body {
  cursor: text;
  border-radius: 6px;
  transition: outline-color 120ms;
  outline: 1.5px dashed transparent;
  outline-offset: 5px;
}
.tweet[data-post-id] .content:hover,
.li-post[data-post-id] .li-post-body:hover {
  outline-color: rgba(29, 155, 240, 0.3);
}
.tweet[data-post-id] .content[contenteditable="true"],
.li-post[data-post-id] .li-post-body[contenteditable="true"] {
  outline: 2px solid #1d9bf0;
  white-space: pre-wrap;
}

.media, .li-post-media { position: relative; }
.media-clear {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tweet:hover .media-clear,
.li-post:hover .media-clear { opacity: 1; }
.media-clear:hover { background: rgba(0, 0, 0, 0.85); }

/* ---------- Platform-specific sidebar field visibility ---------- */

body.platform-x .linkedin-only { display: none; }
body.platform-x .instagram-only { display: none; }
body.platform-linkedin .x-only { display: none; }
body.platform-linkedin .instagram-only { display: none; }
body.platform-instagram .x-only { display: none; }
body.platform-instagram .linkedin-only { display: none; }

/* ---------- Mobile viewport emulation ---------- */

body.viewport-mobile .stage {
  background: transparent;
  padding: 40px 0 100px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden; /* outer stage no longer scrolls; inner phone does */
}
body.preview-dark.viewport-mobile .stage-inner {
  border-color: rgba(255, 255, 255, 0.14);
  background: #000;
}
body.viewport-mobile .stage-inner {
  width: 375px;
  max-width: 375px;
  height: 812px;
  max-height: calc(100vh - 140px);
  border-radius: 44px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  position: relative;
  /* iOS-like inertial scroll */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
body.viewport-mobile .stage-inner::-webkit-scrollbar { width: 4px; }
body.viewport-mobile .stage-inner::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}

/* X in mobile: hide left nav + right rail, full-bleed feed */
body.viewport-mobile .x-page {
  grid-template-columns: minmax(0, 1fr);
}
body.viewport-mobile .x-nav,
body.viewport-mobile .x-right {
  display: none;
}
body.viewport-mobile .x-feed { border-right: 0; }
body.viewport-mobile .tweet .name { max-width: 140px; }
body.viewport-mobile .tweet .actions { max-width: 100%; }
body.viewport-mobile .x-composer .placeholder { font-size: 17px; }

/* LinkedIn in mobile: hide side rails, full-bleed feed */
body.viewport-mobile .li-main {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 8px 8px 24px;
}
body.viewport-mobile .li-left,
body.viewport-mobile .li-right {
  display: none;
}
body.viewport-mobile .li-header {
  padding: 0 12px;
}
body.viewport-mobile .li-nav-item {
  min-width: 0;
  padding: 4px 6px;
}
body.viewport-mobile .li-nav-item span:not(.dot):not(.bg) {
  display: none;
}

/* Tighter padding for phone feel */
body.viewport-mobile .tweet { padding: 10px 12px; }
body.viewport-mobile .x-composer { padding: 6px 12px; }
body.viewport-mobile .li-post-head { padding: 10px 12px 6px; }
body.viewport-mobile .li-post-body { padding: 0 12px 6px; font-size: 14px; }
body.viewport-mobile .li-composer { padding: 10px 12px; }

/* ---------- Narrow screen adjustments ---------- */

@media (max-width: 1300px) {
  .x-page { grid-template-columns: 88px minmax(0, 600px) minmax(290px, 350px); }
  .x-nav-item .lbl { display: none; }
  .x-nav-item { justify-content: center; padding: 12px; }
  .x-post-btn .lbl { display: none; }
  .x-post-btn::before { content: "+"; font-size: 24px; }
  .x-profile .info { display: none; }
}
@media (max-width: 1100px) {
  .li-main { grid-template-columns: minmax(0, 540px) 300px; }
  .li-left { display: none; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    height: auto;
    max-height: calc(100vh - 32px);
  }
  .stage { padding-left: 0; padding-top: 96px; }
  body.viewport-mobile .stage { padding-left: 0; padding-top: 96px; }
  .vp-dock { left: 50%; }
  .x-page { grid-template-columns: minmax(0, 1fr); }
  .x-nav, .x-right { display: none; }
  .li-main { grid-template-columns: minmax(0, 1fr); }
  .li-right { display: none; }
  .ig-page { grid-template-columns: minmax(0, 1fr); }
  .ig-nav, .ig-right { display: none; }
}

/* ========================================================
   Instagram full-page
   ======================================================== */

.ig-page {
  display: grid;
  grid-template-columns: 244px minmax(0, 470px) 340px;
  gap: 0 56px;
  max-width: 1110px;
  margin: 0 auto;
  padding: 20px 0 60px;
  align-items: start;
  background: #fafafa;
  color: #262626;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14px;
}

.ig-page.force-dark {
  background: #000;
  color: #f5f5f5;
}
.ig-page.force-dark .ig-nav-logo,
.ig-page.force-dark .ig-nav-item,
.ig-page.force-dark .ig-story-name,
.ig-page.force-dark .ig-post-head-more,
.ig-page.force-dark .ig-post-action,
.ig-page.force-dark .ig-post-dot,
.ig-page.force-dark .ig-suggestions-see-all {
  color: #f5f5f5;
}
.ig-page.force-dark .ig-nav-item:hover,
.ig-page.force-dark .ig-nav-profile-row:hover {
  background: #121212;
}
.ig-page.force-dark .ig-nav-profile-info .username,
.ig-page.force-dark .ig-post-location,
.ig-page.force-dark .ig-post-comments-link,
.ig-page.force-dark .ig-right-handle,
.ig-page.force-dark .ig-suggestions-header,
.ig-page.force-dark .ig-sug-sub {
  color: #a8a8a8;
}
.ig-page.force-dark .ig-stories {
  border-bottom-color: #262626;
}
.ig-page.force-dark .ig-story-ring.seen {
  background: #363636;
}
.ig-page.force-dark .ig-story-av {
  border-color: #000;
}
.ig-page.force-dark .ig-story.you .ig-story-plus {
  border-color: #000;
}
.ig-page.force-dark .ig-post {
  background: #000;
  border-color: #262626;
}
.ig-page.force-dark .ig-post-image-wrap {
  background: #121212;
}
.ig-page.force-dark .ig-post-image-placeholder {
  background: linear-gradient(135deg, #151515 0%, #0f0f0f 100%);
  color: #6f6f6f;
}
.ig-page.force-dark .ig-post-time,
.ig-page.force-dark .ig-right-footer,
.ig-page.force-dark .ig-right-footer a {
  color: #737373;
}
body.viewport-mobile .ig-page.force-dark .ig-mobile-header {
  background: #000;
  border-bottom-color: #262626;
}
body.viewport-mobile .ig-page.force-dark .ig-mobile-tabbar {
  background: #000;
  border-top-color: #262626;
}

/* ----- Nav sidebar ----- */
.ig-nav {
  position: sticky;
  top: 20px;
  padding: 8px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ig-nav-logo {
  font-family: "Billabong", "Dancing Script", cursive;
  font-size: 26px;
  letter-spacing: -0.5px;
  padding: 16px 12px 8px;
  margin-bottom: 4px;
  color: #262626;
  text-decoration: none;
  display: block;
}
.ig-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  color: #262626;
  transition: background 120ms ease;
  user-select: none;
  white-space: nowrap;
}
.ig-nav-item:hover { background: #f0f0f0; }
.ig-nav-item.active { font-weight: 700; }
.ig-nav-item svg { flex-shrink: 0; }
.ig-nav-spacer { margin-top: auto; }
.ig-nav-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
}
.ig-nav-profile-row:hover { background: #f0f0f0; }
.ig-nav-profile-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #c7c7c7;
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #fff;
  flex-shrink: 0;
}
.ig-nav-profile-info .name { font-size: 14px; font-weight: 600; }
.ig-nav-profile-info .username { font-size: 13px; color: #737373; }
.ig-nav-more { margin-top: 8px; }

/* ----- Feed ----- */
.ig-feed { padding-top: 0; }

/* Stories bar */
.ig-stories {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 16px 0 20px;
  scrollbar-width: none;
  border-bottom: 1px solid #dbdbdb;
  margin-bottom: 4px;
}
.ig-stories::-webkit-scrollbar { display: none; }
.ig-story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}
.ig-story-ring {
  width: 60px; height: 60px;
  border-radius: 50%;
  padding: 1px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  display: flex; align-items: center; justify-content: center;
}
.ig-story-ring.seen {
  background: #dbdbdb;
}
.ig-story-av {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #c7c7c7;
  background-size: cover;
  background-position: center;
  border: 1px solid #fafafa;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff;
}
.ig-story-name {
  font-size: 12px;
  color: #262626;
  max-width: 70px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ig-story.you .ig-story-av {
  position: relative;
}
.ig-story.you .ig-story-plus {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #0095f6;
  color: #fff;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #fafafa;
}

/* Post card */
.ig-post {
  background: #fff;
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  margin-bottom: 24px;
}
.ig-post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.ig-post-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #c7c7c7;
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
  border: 2px solid transparent;
  outline: 2px solid transparent;
  box-sizing: border-box;
}
.ig-post-av.has-story {
  outline: 2px solid #e1306c;
  outline-offset: 2px;
}
.ig-post-username { font-weight: 700; font-size: 14px; flex: 1; }
.ig-post-location { font-size: 12px; color: #737373; }
.ig-post-head-more { margin-left: auto; color: #262626; cursor: pointer; }
.ig-post-follow { font-size: 14px; font-weight: 700; color: #0095f6; cursor: pointer; }
.ig-post-dot { font-size: 4px; color: #262626; margin: 0 2px; }

.ig-post-image-wrap {
  width: 100%;
  position: relative;
  background: #f0f0f0;
  display: block;
}
.ig-post-image-wrap img {
  width: 100%;
  max-height: 585px;
  min-height: 200px;
  object-fit: cover;
  display: block;
}
.ig-post-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  display: flex; align-items: center; justify-content: center;
  color: #c7c7c7;
}

.ig-post-actions {
  display: flex;
  align-items: center;
  padding: 8px 16px 4px;
  gap: 16px;
}
.ig-post-action {
  display: flex;
  align-items: center;
  gap: 0;
  color: #262626;
  cursor: pointer;
  padding: 4px 0;
  background: none;
  border: none;
  transition: opacity 120ms ease;
}
.ig-post-action:hover { opacity: 0.6; }
.ig-post-action.liked svg { fill: #ed4956; stroke: #ed4956; }
.ig-post-bookmark { margin-left: auto; }

.ig-post-likes {
  padding: 4px 16px 2px;
  font-size: 14px;
  font-weight: 700;
}
.ig-caption {
  padding: 4px 16px 4px;
  font-size: 14px;
  line-height: 1.5;
}
.ig-caption .ig-caption-username { font-weight: 700; margin-right: 4px; }
.ig-caption-text { cursor: text; display: inline; }
.ig-caption-text[contenteditable="true"] {
  display: block;
  outline: none;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  padding: 4px 6px;
  margin: 2px 0;
}
.ig-post-comments-link {
  padding: 2px 16px;
  font-size: 14px;
  color: #737373;
  cursor: pointer;
}
.ig-post-time {
  padding: 4px 16px 16px;
  font-size: 10px;
  color: #c7c7c7;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Right rail */
.ig-right {
  padding-top: 20px;
}
.ig-right-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 20px;
}
.ig-right-av {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #c7c7c7;
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: #fff;
  flex-shrink: 0;
}
.ig-right-name { font-weight: 700; font-size: 14px; }
.ig-right-handle { font-size: 14px; color: #737373; }
.ig-right-switch {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #0095f6;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 120ms ease;
}
.ig-right-switch:hover { opacity: 0.6; }

.ig-suggestions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #737373;
}
.ig-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.ig-sug-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.ig-sug-info { flex: 1; min-width: 0; }
.ig-sug-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-sug-sub { font-size: 12px; color: #737373; }
.ig-sug-follow {
  font-size: 13px;
  font-weight: 700;
  color: #0095f6;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  transition: opacity 120ms ease;
}
.ig-sug-follow:hover { opacity: 0.6; }

.ig-suggestions-see-all {
  font-weight: 700;
  color: #262626;
  cursor: pointer;
  font-size: 12px;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 120ms ease;
}
.ig-suggestions-see-all:hover { opacity: 0.6; }

.ig-right-footer {
  padding-top: 20px;
  font-size: 11px;
  color: #c7c7c7;
  line-height: 1.6;
}
.ig-right-footer a { color: #c7c7c7; text-decoration: none; margin-right: 6px; }
.ig-right-footer a:hover { text-decoration: underline; }

/* Instagram mobile */
body.viewport-mobile .ig-page {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  gap: 0;
}
body.viewport-mobile .ig-nav,
body.viewport-mobile .ig-right { display: none; }
body.viewport-mobile .ig-feed { padding: 0; }
body.viewport-mobile .ig-mobile-header {
  display: flex !important;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dbdbdb;
}
.ig-mobile-header { display: none; }
body.viewport-mobile .ig-mobile-tabbar {
  display: flex !important;
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid #dbdbdb;
  padding: 10px 0 20px;
  justify-content: space-around;
  z-index: 20;
}
.ig-mobile-tabbar { display: none; }
body.viewport-mobile .ig-post { border-radius: 0; border-left: 0; border-right: 0; }
body.viewport-mobile .ig-stories { padding: 12px 12px 16px; gap: 12px; }

/* Instagram narrow screen */
@media (max-width: 1300px) {
  .ig-page { grid-template-columns: 72px minmax(0, 470px) minmax(280px, 340px); gap: 0 32px; }
  .ig-nav-item span, .ig-nav-logo { display: none; }
  .ig-nav-item { justify-content: center; }
  .ig-nav-profile-row .ig-nav-profile-info { display: none; }
}
@media (max-width: 1100px) {
  .ig-page { grid-template-columns: 72px minmax(0, 470px); }
  .ig-right { display: none; }
}
