/* styles.css — Catbook, a Facebook-faithful skin. Light & dark themes. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root, [data-theme="light"] {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text-1: #050505;
  --text-2: #65676b;
  --divider: #ced0d4;
  --divider-soft: #e4e6eb;
  --hover: rgba(0,0,0,0.05);
  --hover-2: rgba(0,0,0,0.08);
  --input: #f0f2f5;
  --accent: #1877f2;
  --accent-deep: #1467d8;
  --accent-soft: #e7f3ff;
  --accent-text: #1877f2;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.12);
  --shadow-2: 0 12px 28px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1);
  --nav-h: 56px;
  --danger: #e41e3f;
  --online: #31a24c;
  --lb-stage: rgba(240,242,245,0.94);
}
[data-theme="dark"] {
  --bg: #18191a;
  --card: #242526;
  --text-1: #e4e6eb;
  --text-2: #b0b3b8;
  --divider: #3e4042;
  --divider-soft: #323436;
  --hover: rgba(255,255,255,0.08);
  --hover-2: rgba(255,255,255,0.13);
  --input: #3a3b3c;
  --accent: #2d88ff;
  --accent-deep: #1877f2;
  --accent-soft: rgba(45,136,255,0.2);
  --accent-text: #4596ff;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 12px 28px rgba(0,0,0,0.55), 0 2px 4px rgba(0,0,0,0.4);
  --danger: #f02849;
  --lb-stage: rgba(0,0,0,0.92);
}
html { transition: background-color .35s ease; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.34;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}
body.modal-open { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea { font: inherit; color: var(--text-1); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--accent-text); }
[data-theme="dark"] ::selection { background: rgba(45,136,255,0.35); color: #fff; }
.muted-sm { color: var(--text-2); font-size: 12.5px; }
.inv { color: rgba(255,255,255,0.75); }

/* slim themed scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(128,128,128,0.45) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.4); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.6); }

.ic { width: 22px; height: 22px; flex: none; }
.ic-sm { width: 17px; height: 17px; }
.ic-xs { width: 13px; height: 13px; vertical-align: -2px; }
.ic-green { color: #45bd62; } .ic-yellow { color: #f7b928; } .ic-red { color: #f02849; } .ic-blue { color: var(--accent); }
.ic-inv { color: #fff; width: 28px; height: 28px; }
.rot-180 { transform: rotate(180deg); }
.rot-up { transform: rotate(90deg); }

/* ---------------------------------------------------------------- topbar -- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: var(--nav-h);
  background: var(--card);
  box-shadow: var(--shadow-1);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; gap: 8px;
  transition: background-color .35s ease;
}
.tb-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.tb-logo { display: flex; align-items: center; gap: 6px; border-radius: 50%; }
.tb-word { font-weight: 800; font-size: 24px; color: var(--accent); letter-spacing: -1.2px; }
.tb-search { position: relative; display: flex; align-items: center; }
.tb-search-ic { position: absolute; left: 12px; color: var(--text-2); pointer-events: none; }
.tb-search-input {
  width: 240px; height: 40px; border: 0; border-radius: 20px;
  background: var(--input); padding: 0 14px 0 36px; outline: none;
  transition: background-color .3s, box-shadow .2s;
}
.tb-search-input:focus { box-shadow: 0 0 0 1.5px var(--accent); background: var(--card); }
[data-theme="dark"] .tb-search-input:focus { background: var(--input); }
.tb-search-input::placeholder { color: var(--text-2); }
.tb-suggest {
  position: absolute; top: 46px; left: 0; width: 320px; max-height: 60vh; overflow: auto;
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; z-index: 400;
}
.sug-row { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border-radius: 8px; text-align: left; }
.sug-row:hover, .sug-row:focus-visible { background: var(--hover); }
.sug-row span { display: flex; flex-direction: column; min-width: 0; }
.sug-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--input); display: grid; place-items: center; color: var(--text-2); flex: none; }
.sug-empty { padding: 14px; color: var(--text-2); font-size: 13.5px; }

.tb-nav { display: flex; align-items: stretch; gap: 4px; height: 100%; flex: 0 1 auto; }
.tb-navbtn {
  display: flex; align-items: center; justify-content: center;
  width: 104px; height: calc(100% - 6px); margin: 3px 0;
  border-radius: 8px; color: var(--text-2); position: relative;
  transition: background-color .18s ease, color .18s ease;
}
.tb-navbtn:hover { background: var(--hover); }
.tb-navbtn.active { color: var(--accent); }
.tb-navbtn.active::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: -3px; height: 3px;
  background: var(--accent); border-radius: 2px 2px 0 0;
}
.tb-navlabel { display: none; }
.tb-right { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; }
.tb-circle {
  width: 40px; height: 40px; border-radius: 50%; background: var(--input);
  display: grid; place-items: center; position: relative; color: var(--text-1);
  transition: background-color .2s;
}
.tb-circle:hover { background: var(--hover-2); }
.tb-me { border-radius: 50%; padding: 0; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px;
  background: linear-gradient(180deg, #f0304f, var(--danger)); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 10px; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 0 0 2px var(--card); font-variant-numeric: tabular-nums;
}
.ring { animation: ring .8s ease; }
@keyframes ring { 0%,100% { transform: rotate(0); } 20% { transform: rotate(12deg) scale(1.12); } 45% { transform: rotate(-10deg); } 70% { transform: rotate(6deg); } }

/* ---------------------------------------------------------------- layout -- */
.layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) minmax(220px, 320px);
  gap: 0; max-width: 100%; padding-top: var(--nav-h);
  min-height: 100vh;
}
.leftbar, .rightbar {
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto; padding: 14px 8px; scrollbar-width: thin;
}
.leftbar { justify-self: end; width: 100%; max-width: 320px; }
.rightbar { justify-self: start; width: 100%; max-width: 320px; }
.main { padding: 18px 16px 60px; max-width: 680px; width: 100%; margin: 0 auto; outline: none; }
.main.wide { max-width: 940px; }

.lb-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  border-radius: 8px; font-weight: 600; font-size: 15px;
  transition: background-color .18s ease;
}
.lb-row:hover { background: var(--hover); }
.lb-row:active { background: var(--hover-2); }
.lb-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.lb-sq { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.lb-sep { border-top: 1px solid var(--divider-soft); margin: 8px 10px; }
.lb-title { color: var(--text-2); font-size: 14.5px; font-weight: 600; letter-spacing: 0.01em; margin: 10px 10px 4px; }
.lb-foot { color: var(--text-2); font-size: 12px; padding: 14px 10px; line-height: 1.6; }
.pill { margin-left: auto; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; border-radius: 10px; padding: 2px 8px; }

.rb-title { color: var(--text-2); font-size: 15px; font-weight: 600; letter-spacing: 0.01em; margin: 8px 10px 6px; display: flex; align-items: center; gap: 8px; }
.rb-sep { border-top: 1px solid var(--divider-soft); margin: 12px 10px; }
.rb-section { margin-bottom: 4px; }
.spon { display: flex; gap: 12px; padding: 8px 10px; border-radius: 8px; width: 100%; text-align: left; align-items: center; transition: background-color .18s ease; }
.spon:hover { background: var(--hover); }
.spon-img { width: 100px; height: 74px; border-radius: 8px; overflow: hidden; flex: none; background: var(--input); display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); }
.spon-img svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.spon strong { display: block; font-size: 13.5px; line-height: 1.3; margin-bottom: 2px; }
.rb-req { display: flex; gap: 12px; padding: 8px 10px; align-items: flex-start; }
.rb-req-av { flex: none; border-radius: 50%; }
.rb-req-body { min-width: 0; font-size: 14.5px; }
.rb-req-body .muted-sm { margin-top: 1px; }
.rb-req-btns { display: flex; gap: 8px; margin-top: 7px; }
.rb-req-btns .btn { min-width: 84px; }
.rb-bday { display: flex; gap: 12px; align-items: flex-start; padding: 6px 10px; color: var(--text-2); font-size: 13.5px; line-height: 1.4; margin: 0; }
.rb-bday-ic { color: var(--danger); flex: none; display: grid; place-items: center; margin-top: 1px; }
.rb-bday strong { color: var(--text-1); font-weight: 600; }
.contact { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; font-weight: 600; position: relative; transition: background-color .18s ease; }
.contact:hover { background: var(--hover); }
.dot-online { width: 9px; height: 9px; border-radius: 50%; background: var(--online); position: absolute; left: 33px; bottom: 7px; box-shadow: 0 0 0 2.5px var(--bg); }

/* ----------------------------------------------------------------- cards -- */
.card {
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow-1);
  margin-bottom: 14px; overflow: hidden;
  transition: background-color .35s ease;
}
[data-theme="dark"] .card { box-shadow: var(--shadow-1), inset 0 0 0 1px rgba(255,255,255,0.04); }
.card.pad { padding: 16px; }
.card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.1px; margin: 0 0 10px; }
.page-title { font-size: 20px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.count-pill { background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 12px; }
.page-narrow { max-width: 680px; margin: 0 auto; }
.page-wide { max-width: 940px; margin: 0 auto; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty h3 { color: var(--text-1); margin: 8px 0 4px; }
.empty p { margin: 4px 0 0; }
.empty.small { padding: 18px; }
.empty-art { font-size: 44px; }

/* ---------------------------------------------------------------- buttons - */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 15px;
  transition: filter .15s, background-color .2s, transform .06s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: var(--input); color: var(--text-1); }
.btn-ghost:hover { background: var(--hover-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; }
.btn-xs { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text-2); transition: background-color .15s;
}
.iconbtn:hover { background: var(--hover); }
.iconbtn-inv { color: #fff; }
.input {
  width: 100%; border: 0; background: var(--input); border-radius: 8px;
  padding: 10px 12px; outline: none;
}
.input-sm { padding: 7px 10px; font-size: 13.5px; }
.clink { color: var(--text-2); font-size: 13px; font-weight: 600; padding: 2px 4px; border-radius: 4px; }
.clink:hover { text-decoration: underline; }
.clink.active { color: var(--accent-text); }

/* switches */
.switch {
  width: 38px; height: 22px; border-radius: 12px; background: var(--divider);
  position: relative; flex: none; transition: background-color .25s; display: inline-block;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.3,1.4,.5,1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }
.switch.lg { width: 52px; height: 30px; }
.switch.lg::after { width: 26px; height: 26px; }
.switch.lg.on::after { transform: translateX(22px); }
button.switch { border: 0; }

/* ---------------------------------------------------------------- stories - */
.stories { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story-card {
  position: relative; width: 112px; height: 176px; border-radius: 10px; overflow: hidden;
  flex: none; box-shadow: var(--shadow-1); background: var(--card); text-align: left;
  transition: transform .18s ease, box-shadow .18s ease;
}
.story-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.story-bg { position: absolute; inset: 0; transition: transform .35s ease; }
.story-card:hover .story-bg { transform: scale(1.05); }
.story-bg svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, transparent 32%, transparent 55%, rgba(0,0,0,0.62)); }
.story-av { position: absolute; top: 10px; left: 10px; z-index: 2; }
.story-av .avatar { border: 3px solid var(--accent); border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.story-card.seen .story-av .avatar { border-color: var(--divider); }
.story-label { position: absolute; bottom: 8px; left: 10px; right: 8px; color: #fff; font-weight: 700; font-size: 12px; line-height: 1.25; letter-spacing: 0.01em; z-index: 2; text-shadow: 0 1px 3px rgba(0,0,0,0.6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-text { position: absolute; bottom: 40px; left: 10px; right: 8px; color: rgba(255,255,255,0.92); font-size: 10px; font-weight: 500; z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.story-create { display: flex; align-items: flex-end; justify-content: center; }
.story-create .story-bg { height: 70%; bottom: auto; }
.story-plus {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; z-index: 2; border: 4px solid var(--card);
}
.story-create .story-label { color: var(--text-1); text-shadow: none; text-align: center; }

/* --------------------------------------------------------------- composer - */
.composer { padding: 12px 16px 8px; }
.composer-top { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--divider); }
.composer-open {
  flex: 1; text-align: left; background: var(--input); border-radius: 20px;
  padding: 10px 16px; color: var(--text-2); font-size: 16px;
  transition: background-color .18s ease;
}
.composer-open:hover { background: var(--hover-2); }
.composer-actions { display: flex; padding-top: 6px; }
.composer-act {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 4px; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: 14px;
  transition: background-color .18s ease;
}
.composer-act:hover { background: var(--hover); }

.composer-modal { min-width: min(480px, 86vw); }
.cm-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.cm-name { font-weight: 700; }
.cm-aud { font-size: 12.5px; color: var(--text-2); background: var(--input); border-radius: 6px; padding: 2px 7px; display: inline-flex; gap: 4px; align-items: center; }
.cm-input {
  width: 100%; border: 0; background: transparent; resize: none; outline: none;
  font-size: 17px; padding: 6px 2px; min-height: 66px; color: var(--text-1);
}
.cm-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--divider); border-radius: 10px; padding: 8px 12px; margin: 10px 0;
  font-weight: 600; font-size: 14px; color: var(--text-2);
}
.cm-tools { display: flex; gap: 2px; }
.cm-post { width: 100%; }
.cm-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-text);
  border-radius: 14px; padding: 5px 10px; font-size: 13px; font-weight: 600; margin: 4px 6px 4px 0;
}
.chip-x { font-size: 11px; opacity: 0.7; padding: 0 2px; }
.cm-picker { border: 1px solid var(--divider); border-radius: 10px; margin-top: 10px; overflow: hidden; }
.cm-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--divider); flex-wrap: wrap; }
.cm-picker-head .input { max-width: 200px; }
.cm-picker-list { max-height: 200px; overflow-y: auto; padding: 6px; }
.picker-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 14px; transition: background-color .15s ease; }
.picker-item:hover { background: var(--hover); }
.scene-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 10px; }
.scene-pick { border-radius: 8px; overflow: hidden; position: relative; border: 2px solid transparent; padding: 0; }
.scene-pick svg { display: block; width: 100%; height: auto; }
.scene-pick span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.55); color: #fff; font-size: 10.5px; padding: 2px 4px; }
.scene-pick.sel { border-color: var(--accent); }
.cm-photos { margin-top: 8px; }

/* ------------------------------------------------------------------ posts - */
.post { padding-bottom: 4px; }
.post-enter { animation: postin .45s cubic-bezier(.2,.9,.3,1.1); }
@keyframes postin { from { opacity: 0; transform: translateY(-14px) scale(0.98); } }
.post-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 8px; }
.post-av { flex: none; border-radius: 50%; transition: filter .15s ease; }
.post-av:hover { filter: brightness(0.96); }
.post-id { flex: 1; min-width: 0; font-size: 15px; line-height: 1.3; }
.post-id .catname { font-weight: 700; cursor: pointer; }
.post-id .catname:hover { text-decoration: underline; }
.post-feeling { color: var(--text-2); font-weight: 400; }
.post-feeling a, .post-feeling strong { color: var(--text-1); font-weight: 600; }
.post-meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.post-text { padding: 4px 16px 10px; font-size: 15px; line-height: 1.42; overflow-wrap: break-word; }
.post-text.truncated .seemore { color: var(--text-2); font-weight: 600; display: inline; padding: 0; }
.post-text .seemore:hover { text-decoration: underline; }

.photo-grid { display: grid; gap: 3px; }
.photo-grid svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid.g1 { grid-template-columns: 1fr; }
.photo-grid.g2 { grid-template-columns: 1fr 1fr; }
.photo-grid.g3 { grid-template-columns: 1fr 1fr; }
.photo-grid.g3 .pg-item:first-child { grid-row: span 2; }
.pg-item { position: relative; padding: 0; overflow: hidden; min-height: 90px; display: block; }
.pg-item:hover { filter: brightness(1.04); }
.pg-more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,0.45); color: #fff; font-size: 26px; font-weight: 700;
}
.pg-x {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 26px; height: 26px;
  border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; font-size: 12px;
}

.shared-card { border: 1px solid var(--divider); border-radius: 10px; margin: 0 12px 10px; overflow: hidden; }
.shared-card .post-text { padding: 2px 12px 8px; }

.post-counts {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; color: var(--text-2); font-size: 13.5px; gap: 8px;
}
.post-counts-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.rxn-summary { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.rxn-stack { display: inline-flex; align-items: center; }
.rxn-stack .rxn { margin-left: -5px; box-shadow: 0 0 0 2px var(--card); position: relative; }
.rxn-stack .rxn:first-child { margin-left: 0; }
.rxn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; flex: none; line-height: 0;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,0.12);
}
.rxn svg { display: block; }
.rxn-inline { width: 20px; height: 20px; }

.post-actions {
  display: flex; border-top: 1px solid var(--divider-soft); margin: 0 12px; padding: 4px 0;
  position: relative;
}
.post-action {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 7px 4px; border-radius: 6px; color: var(--text-2); font-weight: 600; font-size: 14px;
  transition: background-color .18s ease;
}
.post-action:hover { background: var(--hover); }
.post-action:active { transform: scale(0.97); }
.post-action.reacted { color: var(--accent-text); }
.post-action.reacted.rxn-love { color: #e8234a; }
.post-action.reacted.rxn-hiss { color: #e5451f; }
.post-action.reacted.rxn-haha, .post-action.reacted.rxn-wow, .post-action.reacted.rxn-sad { color: #d99520; }

.rxn-zone { position: relative; flex: 1; display: flex; }
.rxn-zone .post-action { width: 100%; }
.rxn-pop {
  position: absolute; bottom: calc(100% + 6px); left: -6px; z-index: 50;
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow-2);
  padding: 6px 8px; display: flex; gap: 6px;
  opacity: 0; transform: translateY(10px) scale(0.8); transform-origin: bottom left;
  pointer-events: none; transition: opacity .18s, transform .22s cubic-bezier(.2,1.2,.3,1.1);
}
.rxn-pop.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.rxn-pop .rxn {
  width: 40px; height: 40px; font-size: 23px; cursor: pointer;
  transition: transform .18s cubic-bezier(.2,1.4,.4,1);
  transform: scale(0.4); opacity: 0;
}
.rxn-pop.open .rxn { transform: scale(1); opacity: 1; }
.rxn-pop .rxn:hover, .rxn-pop .rxn:focus-visible { transform: scale(1.28) translateY(-5px); }
.rxn-count { transition: transform .2s; display: inline-block; }
.rxn-count.pop { animation: rxnpop .32s cubic-bezier(.2,1.6,.4,1); }
@keyframes rxnpop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* --------------------------------------------------------------- comments - */
.comments { padding: 4px 16px 12px; border-top: 1px solid var(--divider-soft); margin-top: 4px; }
.comment { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
.comment.depth1 { margin-left: 40px; }
.comment.depth2 { margin-left: 40px; }
.comment-body { min-width: 0; }
.comment-bubble {
  background: var(--input); border-radius: 18px; padding: 8px 12px; display: inline-block;
  position: relative; max-width: 100%;
}
.comment-author { font-weight: 700; font-size: 13px; display: block; margin-bottom: 1px; }
.comment-author:hover { text-decoration: underline; }
.comment-text { font-size: 14px; color: var(--text-1); overflow-wrap: break-word; white-space: pre-wrap; line-height: 1.38; }
.comment-likes {
  position: absolute; right: -12px; bottom: -9px; background: var(--card);
  border-radius: 12px; box-shadow: var(--shadow-1), 0 0 0 1px rgba(0,0,0,0.04); padding: 2px 6px 2px 3px;
  font-size: 11.5px; font-weight: 700; display: inline-flex; gap: 4px; align-items: center;
}
.comment-likes .rxn { box-shadow: none; }
.comment-meta { display: flex; gap: 8px; align-items: center; padding: 3px 12px; }
.ctime { color: var(--text-2); font-size: 12px; }
.replies { margin-top: 2px; }
.comment-input-row { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
.comment-input-wrap { flex: 1; position: relative; }
.comment-input {
  width: 100%; border: 0; background: var(--input); border-radius: 16px;
  padding: 9px 14px; resize: none; outline: none; font-size: 14px; min-height: 34px;
  transition: box-shadow .15s;
}
.comment-input:focus { box-shadow: 0 0 0 1.5px var(--accent); }
.ci-hint { position: absolute; right: 12px; bottom: -2px; font-size: 10px; color: var(--text-2); opacity: 0; transition: opacity .2s; pointer-events: none; }
.comment-input:focus ~ .ci-hint { opacity: 0.8; }

/* --------------------------------------------------------------- skeleton - */
.skel { display: inline-block; background: linear-gradient(90deg, var(--input) 25%, var(--hover-2) 50%, var(--input) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-post { padding: 16px; }
.skel-row { display: flex; gap: 10px; margin-bottom: 12px; }
.skel-av { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skel-lines { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.skel-l { height: 12px; width: 100%; margin-bottom: 8px; }
.skel-block { height: 180px; width: 100%; border-radius: 10px; display: block; }

/* ----------------------------------------------------------------- avatar - */
.avatar { display: inline-block; border-radius: 50%; overflow: hidden; flex: none; background: var(--input); vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.07); }
.avatar svg { display: block; }
.catname { font-weight: 700; }
.hc-fstate { display: flex; align-items: center; gap: 5px; }
.hc-fstate .ic-xs { color: var(--accent); }

/* ----------------------------------------------------------------- panels - */
.panel {
  position: fixed; z-index: 500; width: 380px; max-width: calc(100vw - 16px);
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top right;
  transition: opacity .16s, transform .2s cubic-bezier(.2,1.1,.3,1);
  padding: 10px; max-height: min(72vh, 640px); overflow-y: auto;
}
.panel.show { opacity: 1; transform: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; }
.panel-head h3 { margin: 0; font-size: 22px; }
.panel-tabs { display: flex; gap: 6px; padding: 0 8px 8px; }
.ptab { border-radius: 16px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--text-2); transition: background-color .18s ease, color .18s ease; }
.ptab:hover { background: var(--hover); }
.ptab.active { background: var(--accent-soft); color: var(--accent-text); }
.ptab.active:hover { background: var(--accent-soft); }
.notif { display: flex; gap: 12px; width: 100%; text-align: left; padding: 9px 8px; border-radius: 10px; align-items: center; transition: background-color .18s ease; }
.notif:hover { background: var(--hover); }
.notif.unread { background: var(--accent-soft); }
.notif.unread:hover { background: var(--hover); }
.notif-av { position: relative; flex: none; }
.notif-badge {
  position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--card); display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--card);
}
.notif-badge-ic {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; box-shadow: inset 0 -1px 2px rgba(0,0,0,0.18);
}
.notif-badge-ic .ic { width: 11.5px; height: 11.5px; stroke-width: 2.4; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 14px; display: block; line-height: 1.35; }
.notif-time { font-size: 12.5px; color: var(--accent-text); font-weight: 600; }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px; }
.menu-tile {
  display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px;
  background: var(--card); text-align: left; box-shadow: var(--shadow-1);
  transition: background-color .18s ease, transform .12s ease;
}
.menu-tile:hover { background: var(--hover); }
.menu-tile:active { transform: scale(0.98); }
.menu-tile-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.menu-tile span { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.menu-tile strong { font-size: 14px; }
.menu-tile small { color: var(--text-2); font-size: 11.5px; line-height: 1.3; }
.menu-item {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 14.5px;
  transition: background-color .18s ease;
}
.menu-item:hover { background: var(--hover); }
.menu-item span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.menu-item small { color: var(--text-2); font-size: 12px; }
.menu-item.danger { color: var(--danger); }
.menu-sep { border-top: 1px solid var(--divider); margin: 8px 4px; }
.menu {
  position: fixed; z-index: 600; width: 250px; background: var(--card);
  border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px;
  opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .16s;
}
.menu.show { opacity: 1; transform: none; }
.profile-panel { width: 320px; }
.profile-link { padding: 10px; }

/* ----------------------------------------------------------------- modal -- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 700; background: rgba(0,0,0,0.45);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; transition: opacity .18s;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-2);
  max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto;
  transform: translateY(12px) scale(0.97); transition: transform .2s cubic-bezier(.2,1.1,.3,1);
}
.modal-backdrop.show .modal { transform: none; }
.modal-head {
  display: flex; align-items: center; justify-content: center; position: relative;
  padding: 16px; border-bottom: 1px solid var(--divider);
}
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.modal-close { position: absolute; right: 12px; top: 11px; background: var(--input); transition: background-color .15s ease; }
.modal-close:hover { background: var(--hover-2); }
.modal-body { padding: 16px; }

/* ----------------------------------------------------------------- toast -- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 900; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1c1e21; color: #fff; border-radius: 12px; padding: 12px 18px;
  font-size: 14.5px; box-shadow: var(--shadow-2); display: flex; gap: 12px; align-items: center;
  opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .3s cubic-bezier(.2,1.1,.3,1);
  pointer-events: auto; max-width: min(92vw, 480px); line-height: 1.4;
}
[data-theme="dark"] .toast { background: #f2f2f2; color: #1c1e21; }
.toast.show { opacity: 1; transform: none; }
.toast-action { color: #8ab8ff; font-weight: 700; }
[data-theme="dark"] .toast-action { color: #1877f2; }

/* -------------------------------------------------------------- hovercard - */
.hovercard {
  position: fixed; z-index: 800; width: 340px; background: var(--card);
  border-radius: 12px; box-shadow: var(--shadow-2); padding: 14px;
  opacity: 0; transform: translateY(4px) scale(0.98); transition: opacity .15s, transform .18s;
}
.hovercard.show { opacity: 1; transform: none; }
.hc-top { display: flex; gap: 12px; align-items: center; }
.hc-name { font-weight: 800; font-size: 17px; }
.hc-sub { color: var(--text-2); font-size: 13px; }
.hc-bio { font-size: 13.5px; color: var(--text-2); margin: 10px 0; line-height: 1.45; }
.hc-actions { display: flex; gap: 8px; }
.hc-actions .btn { flex: 1; }

/* --------------------------------------------------------------- profiles - */
.profile { max-width: 940px; margin: 0 auto; }
.profile-head { padding-bottom: 0; }
.profile-cover { height: 320px; overflow: hidden; border-radius: 0 0 10px 10px; position: relative; }
.profile-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.14)); pointer-events: none; }
.profile-cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-idrow { display: flex; align-items: flex-end; gap: 18px; padding: 0 24px; position: relative; flex-wrap: wrap; }
.profile-avwrap { border-radius: 50%; border: 5px solid var(--card); background: var(--card); line-height: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.16); margin-top: -84px; }
.profile-names { flex: 1; min-width: 220px; padding: 14px 0 10px; }
.profile-names h1 { margin: 0 0 3px; font-size: 28px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; }
.profile-bio { color: var(--text-1); font-size: 14.5px; line-height: 1.4; margin: 2px 0 5px; max-width: 52ch; }
.profile-names .muted-sm { font-weight: 500; }
.profile-actions { display: flex; gap: 8px; padding-bottom: 14px; }
.profile-tabs { display: flex; gap: 2px; border-top: 1px solid var(--divider-soft); margin-top: 8px; padding: 4px 14px; }
.profile-tabs .ptab { border-radius: 8px; padding: 10px 16px; font-size: 15px; position: relative; }
.profile-tabs .ptab.active { background: transparent; color: var(--accent-text); }
.profile-tabs .ptab.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -5px; height: 3px; border-radius: 2px 2px 0 0; background: var(--accent); }
.profile-cols { display: grid; grid-template-columns: 360px 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.intro-line { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 14px; line-height: 1.42; margin: 10px 0; }
.intro-line:first-of-type { margin-top: 4px; }
.intro-line .ic, .intro-line .ic-sm { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--text-2); }
.intro-line strong { color: var(--text-1); font-weight: 600; }
.mini-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mini-photo { padding: 0; border-radius: 8px; overflow: hidden; aspect-ratio: 1; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); }
.mini-photo svg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.mini-photo:hover svg { transform: scale(1.06); }
.mini-friends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-friend { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.mini-friend .avatar { border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05); }
.mini-friend:hover .avatar { filter: brightness(0.97); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.album-photo { padding: 0; border-radius: 8px; overflow: hidden; }
.album-photo svg { width: 100%; height: 100%; object-fit: cover; display: block; }

.group-headrow { padding: 16px 24px 4px; }
.group-headrow h1 { margin: 0; font-size: 26px; }
.group-faces { display: flex; padding: 8px 0; }
.group-faces .avatar { margin-left: -8px; border: 2px solid var(--card); }
.group-faces .avatar:first-child { margin-left: 0; }
.group-actions { padding: 0 24px 16px; display: flex; gap: 8px; }

/* ---------------------------------------------------------------- friends - */
.req-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--divider); align-items: flex-start; }
.req-row:last-of-type { border-bottom: 0; }
.req-body { flex: 1; }
.req-btns { display: flex; gap: 8px; margin-top: 8px; }
.req-btns .btn { min-width: 110px; }
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.friend-card { display: flex; flex-direction: column; margin-bottom: 0; }
.fc-av { display: block; }
.fc-av .avatar { border-radius: 10px 10px 0 0; width: 100% !important; height: auto !important; aspect-ratio: 1; }
.fc-av .avatar svg { width: 100%; height: auto; }
.fc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.fc-tag { font-size: 12px; color: var(--text-2); background: var(--input); border-radius: 10px; padding: 3px 9px; }

/* ----------------------------------------------------------------- groups - */
.group-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--divider-soft); }
.group-row:last-child { border-bottom: 0; }
.group-cover { width: 100px; height: 64px; border-radius: 8px; overflow: hidden; flex: none; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06); transition: filter .18s ease; }
a.group-cover:hover { filter: brightness(0.96); }
.group-cover svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.group-cover.sm { width: 64px; height: 48px; }
.group-body { flex: 1; min-width: 0; }

/* ------------------------------------------------------------------ watch - */
.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 16px; }
.watch-card { text-align: left; padding: 0; display: flex; flex-direction: column; gap: 9px; border-radius: 12px; transition: transform .18s ease; }
.watch-thumb { position: relative; border-radius: 10px; overflow: hidden; display: block; box-shadow: var(--shadow-1); }
.watch-thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.watch-card:hover .watch-thumb svg { transform: scale(1.04); }
.watch-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,0.25); opacity: 0; transition: opacity .2s; color: #fff;
}
.watch-card:hover .watch-play { opacity: 1; }
.watch-len {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,0.75);
  color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
}
.watch-info { display: flex; gap: 10px; align-items: flex-start; }
.watch-info strong { font-size: 14.5px; display: block; line-height: 1.3; }
.watch-player .wp-screen { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.wp-screen svg { width: 100%; height: auto; display: block; }
.wp-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 4px); animation: scan 1.2s linear infinite; pointer-events: none; }
@keyframes scan { from { transform: translateY(-6px); } to { transform: translateY(6px); } }
.wp-bar { height: 4px; background: var(--input); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.wp-fill { display: block; height: 100%; background: var(--danger); width: 0; }
.wp-meta { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }

/* ------------------------------------------------------------ marketplace - */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.market-card { text-align: left; padding: 0; display: flex; flex-direction: column; }
.market-thumb { border-radius: 10px; overflow: hidden; display: block; box-shadow: var(--shadow-1); }
.market-thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.market-card:hover .market-thumb svg { transform: scale(1.05); }
.market-info { padding: 8px 2px 0; display: flex; flex-direction: column; gap: 2px; }
.market-price { font-weight: 800; font-size: 15.5px; }
.market-title { font-size: 13.5px; color: var(--text-1); line-height: 1.3; }
.market-detail .md-photo { border-radius: 10px; overflow: hidden; }
.md-photo svg { width: 100%; height: auto; display: block; }

/* ----------------------------------------------------------------- search - */
.search-row { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; transition: background-color .15s ease; }
.search-row:hover { background: var(--hover); }
.search-row span { display: flex; flex-direction: column; min-width: 0; }
.memory-label { font-weight: 700; color: var(--text-2); margin: 14px 4px 8px; font-size: 14px; }

/* --------------------------------------------------------------- settings - */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.setting-row > div { display: flex; gap: 12px; align-items: center; }
.theme-preview { display: flex; gap: 14px; margin-top: 10px; }
.tp { display: flex; flex-direction: column; gap: 6px; align-items: center; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 8px; border-radius: 10px; }
.tp-card { width: 120px; height: 76px; border-radius: 8px; border: 2px solid var(--divider); }
.tp.light .tp-card { background: linear-gradient(180deg, #fff 30%, #f0f2f5 30%); }
.tp.dark .tp-card { background: linear-gradient(180deg, #242526 30%, #18191a 30%); }
.tp.sel .tp-card { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tp.sel { color: var(--accent-text); }

/* ------------------------------------------------------------ chat dock --- */
.chat-dock {
  position: fixed; right: 12px; bottom: 0; z-index: 650;
  display: flex; gap: 10px; align-items: flex-end; flex-direction: row-reverse;
}
.chat-win {
  width: 300px; background: var(--card); border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(0,0,0,0.06); display: flex; flex-direction: column;
  max-height: 420px; transform: translateY(12px); opacity: 0;
  transition: transform .25s cubic-bezier(.2,1.1,.3,1), opacity .2s, max-height .3s;
}
.chat-win.show { transform: none; opacity: 1; }
.chat-win.min { max-height: 47px; overflow: hidden; }
.chat-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; cursor: pointer;
  border-bottom: 1px solid var(--divider-soft); border-radius: 12px 12px 0 0;
  transition: background-color .18s ease;
}
.chat-head:hover { background: var(--hover); }
.chat-title { font-weight: 700; font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-online { width: 8px; height: 8px; border-radius: 50%; background: var(--online); flex: none; box-shadow: 0 0 0 2px var(--card); }
.chat-head-btns { display: flex; }
.chat-head-btns .iconbtn { width: 28px; height: 28px; color: var(--accent-text); }
.chat-head-btns .ic { width: 16px; height: 16px; }
.chat-body { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 5px; min-height: 220px; }
.msg { display: flex; gap: 6px; align-items: flex-end; }
.msg.mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 78%; padding: 7px 12px; border-radius: 18px; font-size: 14px; line-height: 1.35;
  background: var(--input); overflow-wrap: break-word;
}
.msg.mine .msg-bubble { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 1px 1.5px rgba(20,103,216,0.28); }
.msg.theirs .msg-bubble { border-bottom-left-radius: 5px; }
.msg-bubble.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.msg-bubble.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: bounce 1.1s infinite; }
.msg-bubble.typing span:nth-child(2) { animation-delay: .18s; }
.msg-bubble.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.chat-foot { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--divider-soft); align-items: center; }
.chat-input { flex: 1; border: 0; background: var(--input); border-radius: 16px; padding: 8px 12px; outline: none; font-size: 14px; transition: box-shadow .15s ease; }
.chat-input:focus { box-shadow: 0 0 0 1.5px var(--accent); }
.chat-send { width: 34px; height: 34px; transition: transform .12s ease; }
.chat-send:hover { transform: scale(1.12) rotate(-8deg); }

/* --------------------------------------------------------------- lightbox - */
.lightbox { position: fixed; inset: 0; z-index: 750; display: grid; grid-template-columns: 1fr 380px; background: var(--lb-stage); backdrop-filter: blur(6px); }
.lb-stage { position: relative; display: grid; place-items: center; padding: 20px; }
.lb-photo { max-width: 100%; max-height: calc(100vh - 40px); border-radius: 10px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,0.35); }
.lb-photo svg { display: block; max-width: 100%; height: auto; }
.lb-close { position: absolute; top: 14px; left: 14px; background: rgba(80,80,84,0.55); color: #fff; backdrop-filter: blur(6px); z-index: 3; }
.lb-close:hover { background: rgba(80,80,84,0.75); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(80,80,84,0.55); color: #fff; backdrop-filter: blur(6px); z-index: 3; width: 44px; height: 44px; transition: background-color .15s ease, transform .15s ease; }
.lb-nav:hover { background: rgba(80,80,84,0.8); transform: translateY(-50%) scale(1.06); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(80,80,84,0.55); color: #fff; backdrop-filter: blur(6px); padding: 4px 12px; border-radius: 12px; font-weight: 600; }
.lb-side { background: var(--card); overflow-y: auto; padding: 14px; border-left: 1px solid var(--divider-soft); }
.lb-posthead { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.lb-comments { max-height: none; }
.lb-input { display: flex; gap: 8px; margin-top: 12px; align-items: flex-start; position: sticky; bottom: 0; background: var(--card); padding-top: 8px; }
.lb-input .comment-input { border-radius: 14px; }

/* --------------------------------------------------------------- stories -- */
.story-viewer { position: fixed; inset: 0; z-index: 760; background: rgba(10,10,12,0.94); display: flex; align-items: center; justify-content: center; gap: 16px; }
.sv-card { width: min(420px, 92vw); border-radius: 14px; overflow: hidden; position: relative; background: #111; box-shadow: var(--shadow-2); }
.sv-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 110px; background: linear-gradient(180deg, rgba(0,0,0,0.5), transparent); z-index: 2; pointer-events: none; }
.sv-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 110px; background: linear-gradient(0deg, rgba(0,0,0,0.5), transparent); z-index: 2; pointer-events: none; }
.sv-scene svg { width: 100%; height: auto; display: block; }
.sv-progress { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.svp { flex: 1; height: 3.5px; background: rgba(255,255,255,0.3); border-radius: 2px; overflow: hidden; }
.svp-fill { display: block; height: 100%; width: 0; background: #fff; }
.svp.done .svp-fill { width: 100%; }
.sv-head { position: absolute; top: 22px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: center; color: #fff; z-index: 3; text-shadow: 0 1px 3px rgba(0,0,0,0.6); }
.sv-text { position: absolute; bottom: 16px; left: 14px; right: 14px; color: #fff; font-size: 16px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,0.7); z-index: 3; }
.sv-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.15); color: #fff; z-index: 4; }
.sv-nav { background: rgba(255,255,255,0.14); color: #fff; flex: none; }

/* ------------------------------------------------------------ offline ----- */
.offline-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 950;
  background: var(--danger); color: #fff; text-align: center;
  padding: 10px; font-weight: 600; font-size: 14px;
}

/* ------------------------------------------------------------- mobilebar -- */
.mobilebar { display: none; }

/* ------------------------------------------------------------- responsive - */
@media (max-width: 1260px){
  .rightbar { display: none; }
  .layout { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); }
}
@media (max-width: 1100px){
  .tb-navbtn { width: 72px; }
}
@media (max-width: 920px){
  .leftbar { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .main { min-width: 0; }
  .feed { min-width: 0; }
  .tb-nav { display: none; }
  .mobilebar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
    background: var(--card); box-shadow: 0 -1px 4px rgba(0,0,0,0.12);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around;
  }
  .mobilebar .tb-navbtn { width: 64px; height: 48px; margin: 0; flex-direction: column; gap: 2px; }
  .mobilebar .tb-navlabel { display: block; font-size: 10px; }
  .mobilebar .tb-navbtn.active::after { bottom: -4px; }
  .main { padding-bottom: 96px; }
  .tb-word { display: none; }
  .tb-search-input { width: 170px; }
  .profile-cols { grid-template-columns: 1fr; }
  .profile-left { order: 2; }
  .chat-dock { right: 8px; left: 8px; justify-content: flex-end; }
  .chat-win { width: min(300px, 88vw); }
  .lightbox { grid-template-columns: 1fr; }
  .lb-side { display: none; }
  .story-viewer { gap: 0; }
  .sv-nav { display: none; }
}
@media (max-width: 560px){
  .tb-search-input { width: 130px; }
  .tb-right { gap: 5px; }
  .tb-circle { width: 36px; height: 36px; }
  .stories { margin: 0 -16px 12px; padding: 0 8px 4px; }
  .profile-idrow { padding: 0 14px; }
  .profile-names h1 { font-size: 22px; }
  .profile-cover { height: 190px; }
  .profile-avwrap { margin-top: -60px; }
  .profile-avwrap .avatar { width: 120px !important; height: 120px !important; }
  .profile-avwrap .avatar svg { width: 120px; height: 120px; }
  .req-btns .btn { min-width: 0; flex: 1; }
  .post-actions .post-action { font-size: 13px; gap: 4px; }
  .panel { right: 8px !important; width: calc(100vw - 16px); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
