/* BysCial — base styles. Themes override the custom properties in themes.css. */
:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --surface-3: #e6e9f2;
  --text: #1c2033;
  --text-2: #5d6480;
  --border: #e3e6ef;
  --primary: #5b5bf0;
  --primary-2: #8a5cf6;
  --primary-soft: #ececfe;
  --on-primary: #ffffff;
  --danger: #e5484d;
  --warn: #f5a524;
  --success: #2fb37a;
  --online: #2fb37a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 50, .06), 0 4px 16px rgba(20, 24, 50, .05);
  --topbar: rgba(255, 255, 255, .86);
  --font: "Noto Sans Thai", "Sarabun", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/var(--lh, 1.5) var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
body.no-scroll { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
h1, h2, h3, h4 { line-height: var(--lh-head, 1.25); margin: 0 0 .5em; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

.icon { width: 22px; height: 22px; flex: none; }
.icon-xs { width: 14px; height: 14px; vertical-align: -2px; }
.muted { color: var(--text-2); }
.small, small { font-size: 12.5px; }
.pad { padding: 16px; }
.center { text-align: center; }
.center-block { display: block; text-align: center; margin: 8px auto; }
.spacer { flex: 1; }
.inline { display: inline; }
.stack { display: grid; gap: 16px; }
.narrow { max-width: 720px; margin-inline: auto; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 18px;
  font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: filter .15s, background .15s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warn { background: var(--warn); color: #241a00; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-xs { padding: 3px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn-primary { background: var(--primary-soft); color: var(--primary); }
.link-btn { border: 0; background: none; padding: 0; color: var(--text-2); font-weight: 600; cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.is-reacted { color: var(--primary); }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=url],
input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.form h3 { margin: 10px 0 0; font-size: 16px; }
label.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
label.check input { width: auto; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }
.pill-danger { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card-title { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.empty-state { text-align: center; color: var(--text-2); padding: 36px 16px; }
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto 8px; opacity: .6; }

/* ---------- avatars ---------- */
.avatar { position: relative; display: inline-block; flex: none; border-radius: 50%; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.avatar-xs { width: 26px; height: 26px; }
.avatar-sm { width: 34px; height: 34px; }
.avatar-md { width: 42px; height: 42px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 150px; height: 150px; }
.avatar.is-online::after {
  content: ""; position: absolute; inset-inline-end: 0; bottom: 0; width: 28%; height: 28%; min-width: 9px; min-height: 9px;
  background: var(--online); border: 2px solid var(--surface); border-radius: 50%;
}
.avatar-link { display: inline-block; flex: none; }
.avatar-img-xs { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.verified { display: inline-flex; width: 16px; height: 16px; margin-inline-start: 4px; color: var(--primary); vertical-align: -2px; }
.verified svg { width: 100%; height: 100%; }
/* Gold tick: site owner / CEO and pages the owner invited. */
.verified.is-gold { color: #d4a017; filter: drop-shadow(0 0 1px rgba(150, 105, 0, .45)); }.trend-gold { color: #b8860b; font-weight: 600; }
.gold-invite[open] { display: block; margin: 6px 0; }
.owner-pill { background: linear-gradient(135deg, #f7d774, #d4a017); color: #3d2a00; font-weight: 600; }
.dot-online { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--online); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; background: var(--topbar); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1280px; margin: 0 auto; height: 60px; padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 800; font-size: 21px; letter-spacing: -.3px; text-decoration: none !important; }
.brand img { border-radius: 10px; }
.brand-name { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar-search { position: relative; flex: 1; max-width: 380px; display: flex; align-items: center; }
.topbar-search > .icon { position: absolute; inset-inline-start: 12px; width: 18px; height: 18px; color: var(--text-2); }
.topbar-search input { border-radius: 999px; padding-inline-start: 38px; background: var(--surface-2); border-color: transparent; }
.search-suggest {
  position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.search-suggest .user-row { padding: 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.search-suggest .user-row:hover { background: var(--surface-2); }
.topnav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.topnav-link {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  color: var(--text-2); background: none; border: 0; cursor: pointer;
}
.topnav-link:hover { background: var(--surface-2); color: var(--text); }
.topnav-link.is-active { color: var(--primary); background: var(--primary-soft); }
.topnav-user { border: 0; background: none; padding: 4px; cursor: pointer; border-radius: 50%; }
.badge {
  position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  border: 2px solid var(--surface);
}

/* ---------- dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 240px; z-index: 70;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(20, 24, 50, .16); padding: 6px;
}
.dropdown.is-open > .dropdown-menu { display: block; }
.dropdown-menu > a, .dropdown-menu > button, .dropdown-menu form > button, .dropdown-form label {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text); background: none; border: 0; text-align: start; cursor: pointer; text-decoration: none !important; font-size: 14.5px;
}
.dropdown-menu > a:hover, .dropdown-menu > button:hover, .dropdown-menu form > button:hover { background: var(--surface-2); }
.dropdown-menu .icon { width: 19px; height: 19px; color: var(--text-2); }
.dropdown-form select { padding: 5px 8px; }
.dropdown-profile span { display: grid; }
.dropdown-profile small { color: var(--text-2); }
.dropdown-wide { width: min(380px, 92vw); padding: 0; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dropdown-body { max-height: 70vh; overflow: auto; padding: 6px; }

/* ---------- announcements & flashes ---------- */
.announcement { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); text-align: center; padding: 8px 16px; font-weight: 600; }
.announcement a { color: inherit; text-decoration: underline; }
.announcement-warn { background: var(--warn); color: #241a00; }
.flash { position: relative; padding: 12px 40px 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 600; border: 1px solid; }
.flash-success { background: color-mix(in srgb, var(--success) 12%, var(--surface)); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.flash-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.flash-close { position: absolute; inset-inline-end: 8px; top: 6px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text-2); }
.toasts { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.toast-error { background: var(--danger); color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(10px); }

/* ---------- layout ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 20px 16px 90px; }
.layout-3 { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.layout-2 { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.main-col { display: grid; gap: 16px; min-width: 0; max-width: 680px; width: 100%; margin-inline: auto; }
.side { display: grid; gap: 16px; position: sticky; top: 80px; }
.page-title { font-size: 24px; margin: 0; }

.side-nav { display: grid; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: var(--text); font-weight: 600; text-decoration: none !important; }
.side-link:hover { background: var(--surface-3); }
.side-link.is-active { background: var(--primary-soft); color: var(--primary); }
.side-link .icon { color: var(--primary); }
.side-section { margin-top: 16px; }
.side-section h4 { color: var(--text-2); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; padding: 0 10px; }
.community-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 800; flex: none; }
.side-footer { color: var(--text-2); font-size: 12.5px; padding: 0 6px; }
.side-footer a { color: var(--text-2); }

.widget h4 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 10px; }
.widget h4 a { color: var(--text); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--text); }
.user-row .name { color: var(--text); font-weight: 600; }
.user-row-text { display: grid; flex: 1; min-width: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 13px; }

/* ---------- composer ---------- */
.composer { display: grid; gap: 12px; }
.composer-top { display: flex; gap: 12px; align-items: flex-start; }
.composer-top textarea { border: 0; background: var(--surface-2); border-radius: 18px; resize: none; min-height: 46px; font-size: 16px; }
.composer-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 0; background: none; color: var(--text-2); font-weight: 600; cursor: pointer; font-size: 14px; }
.chip:hover, .chip.is-active { background: var(--surface-2); color: var(--text); }
.chip .icon { width: 19px; height: 19px; color: var(--primary); }
.privacy-select { width: auto; padding: 6px 10px; border-radius: 999px; }
.composer-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.composer-previews img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.composer-panel { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 8px; }
.poll-inputs { display: grid; gap: 6px; }
.bg-picker { display: flex; gap: 8px; flex-wrap: wrap; }
/* The swatch label itself must not get the gradient (only its rounded span), or square corners show. */
.bg-swatch, .bg-swatch[class*="bg-"] { cursor: pointer; background: none; }
.bg-swatch input { display: none; }
.bg-swatch span { display: block; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--border); }
.bg-swatch.bg-none span { background: var(--surface); }
.bg-swatch input:checked + span { outline: 3px solid var(--primary); outline-offset: 2px; }

/* post backgrounds */
.bg-sunrise, .bg-swatch.bg-sunrise span, .composer-top textarea.bg-sunrise { background: linear-gradient(135deg, #ff9a8b, #ff6a88 55%, #ff99ac); }
.bg-ocean, .bg-swatch.bg-ocean span, .composer-top textarea.bg-ocean { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.bg-candy, .bg-swatch.bg-candy span, .composer-top textarea.bg-candy { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.bg-forest, .bg-swatch.bg-forest span, .composer-top textarea.bg-forest { background: linear-gradient(135deg, #11998e, #38ef7d); }
.bg-night, .bg-swatch.bg-night span, .composer-top textarea.bg-night { background: linear-gradient(135deg, #232526, #414345); }
.bg-fire, .bg-swatch.bg-fire span, .composer-top textarea.bg-fire { background: linear-gradient(135deg, #f12711, #f5af19); }
.post-body.bg-sunrise, .post-body.bg-ocean, .post-body.bg-candy, .post-body.bg-forest, .post-body.bg-night, .post-body.bg-fire {
  color: #fff; font-size: 24px; font-weight: 700; text-align: center; min-height: 220px; display: grid; place-items: center;
  padding: 30px 20px; border-radius: var(--radius-sm); text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.post-body[class*="bg-"] a { color: #fff; text-decoration: underline; }
/* Composer: live preview of the chosen background. */
.composer-top textarea.has-bg { color: #fff; font-size: 22px; font-weight: 700; text-align: center; min-height: 160px; padding: 48px 16px; border-radius: var(--radius-sm); text-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.composer-top textarea.has-bg::placeholder { color: rgba(255, 255, 255, .85); }
/* × on each picked photo / video before posting. */
.preview-item { position: relative; }
.preview-remove { position: absolute; top: 4px; inset-inline-end: 4px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.preview-remove:hover { background: var(--danger, #e5484d); }

/* ---------- posts ---------- */
.feed { display: grid; gap: 16px; }
.post { display: grid; gap: 10px; padding-bottom: 6px; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-meta { flex: 1; min-width: 0; }
.post-names { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.post-names .name { color: var(--text); font-weight: 700; }
.post-names .arrow { color: var(--text-2); font-size: 11px; }
.post-sub { display: flex; gap: 4px; align-items: center; color: var(--text-2); font-size: 13px; flex-wrap: wrap; }
.post-sub a { color: var(--text-2); }
.post-body { white-space: normal; overflow-wrap: anywhere; font-size: 15.5px; }
.post-edit { display: grid; gap: 8px; }
.hashtag, .mention { font-weight: 600; }
.media-grid { display: grid; gap: 3px; border-radius: var(--radius-sm); overflow: hidden; margin: 0 -16px; }
.media-1 { grid-template-columns: 1fr; }
.media-2 { grid-template-columns: 1fr 1fr; }
.media-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.media-3 .media-item:first-child { grid-row: span 2; }
.media-4 { grid-template-columns: 1fr 1fr; }
.media-item { position: relative; display: block; background: var(--surface-3); }
.media-item img { width: 100%; height: 100%; object-fit: cover; max-height: 640px; }
.media-2 .media-item img, .media-3 .media-item img, .media-4 .media-item img { aspect-ratio: 1; }
.media-1 .media-item img { object-fit: contain; background: #000; height: auto; }
.media-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: 30px; font-weight: 800; }
.shared-post { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 10px; }
.shared-post .media-grid { margin: 0; }
.shared-missing { color: var(--text-2); font-style: italic; }
.post-stats { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); font-size: 13.5px; min-height: 22px; }
.post-counts { display: flex; gap: 12px; }
.reaction-summary { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--text-2); cursor: pointer; padding: 0; }
.reaction-icons { display: inline-flex; }
.reaction-icons span { margin-inline-end: -4px; font-size: 16px; filter: drop-shadow(0 0 1px var(--surface)); }
.post-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 0; }
.post-action {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; border: 0; background: none;
  color: var(--text-2); font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; width: 100%;
}
.post-action:hover { background: var(--surface-2); }
.post-action .icon { width: 20px; height: 20px; }
.react-wrap { position: relative; }
.react-btn.is-reacted { color: var(--primary); }
.react-emoji { font-size: 18px; line-height: 1; }
.react-emoji-idle { filter: grayscale(1); opacity: .7; }
.react-love, .react-angry { color: var(--danger); }
.react-haha, .react-wow, .react-sad { color: var(--warn); }
.react-picker {
  position: absolute; bottom: calc(100% + 4px); inset-inline-start: 0; display: flex; gap: 2px; padding: 5px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
  opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .15s, transform .15s; z-index: 10;
}
/* Invisible bridge over the gap under the picker, so moving up to it doesn't count as leaving. */
.react-picker::after { content: ''; position: absolute; inset-inline: 0; top: 100%; height: 8px; }
.react-wrap.is-picking .react-picker { opacity: 1; pointer-events: auto; transform: none; }
.react-picker button { border: 0; background: none; font-size: 28px; cursor: pointer; transition: transform .12s; padding: 0 2px; }
.react-picker button:hover { transform: scale(1.3) translateY(-4px); }

/* poll */
.poll { display: grid; gap: 6px; }
.poll form { margin: 0; }
.poll-option {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px;
  overflow: hidden; cursor: pointer; text-align: start; font-weight: 600;
}
.poll-option:hover { border-color: var(--primary); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--primary-soft); transition: width .4s; }
.poll-option.is-mine .poll-bar { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.poll-label, .poll-pct { position: relative; display: flex; align-items: center; gap: 6px; }
.poll-total { font-size: 13px; }

/* comments */
.comments { display: grid; gap: 8px; }
.comment-list { display: grid; gap: 8px; }
.comment { display: flex; gap: 8px; }
.comment-main { min-width: 0; }
.comment-bubble { background: var(--surface-2); border-radius: 16px; padding: 7px 12px; display: inline-block; max-width: 100%; }
.comment-bubble .name { color: var(--text); font-weight: 700; font-size: 13.5px; }
.comment-text { overflow-wrap: anywhere; }
.comment-image img { max-width: 220px; border-radius: 12px; margin-top: 4px; }
.comment-meta { display: flex; gap: 10px; align-items: center; padding: 2px 12px; font-size: 12.5px; color: var(--text-2); }
.comment-form { display: flex; gap: 8px; align-items: flex-start; }
.comment-input { flex: 1; display: flex; align-items: center; background: var(--surface-2); border-radius: 20px; padding: 2px 4px 2px 12px; }
.comment-input textarea { border: 0; background: transparent; resize: none; padding: 8px 0; min-height: 36px; box-shadow: none !important; }
.feed-loader { display: grid; place-items: center; padding: 20px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- profile ---------- */
.profile-header { padding: 0; overflow: hidden; }
.profile-cover { height: 300px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); background-size: cover; background-position: center; position: relative; }
.cover-upload { position: absolute; inset-inline-end: 16px; bottom: 16px; }
.profile-info { display: flex; align-items: flex-end; gap: 18px; padding: 0 24px 16px; margin-top: -60px; flex-wrap: wrap; }
.profile-avatar { position: relative; }
.profile-avatar .avatar img { border: 5px solid var(--surface); }
.avatar-upload { position: absolute; inset-inline-end: 6px; bottom: 6px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; border: 2px solid var(--surface); }
.avatar-upload .icon { width: 19px; height: 19px; }
.profile-names { flex: 1; min-width: 200px; padding-bottom: 6px; }
.profile-names h1 { font-size: 28px; margin: 0; display: flex; align-items: center; gap: 4px; }
.profile-names h1 .verified { width: 22px; height: 22px; }
.profile-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 8px; }
.friend-actions { display: flex; gap: 6px; }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-top: 1px solid var(--border); overflow-x: auto; }
.tabs.card { padding: 6px; border-top: 1px solid var(--border); }
.tabs a { padding: 12px 16px; color: var(--text-2); font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none !important; }
.tabs.card a { padding: 8px 14px; border-radius: var(--radius-sm); border-bottom: 0; }
.tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs.card a.is-active { background: var(--primary-soft); }
.bio { overflow-wrap: anywhere; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.facts li { display: flex; align-items: center; gap: 10px; }
.facts .icon { color: var(--text-2); width: 20px; height: 20px; }
.thumb-grid, .friend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumb-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }
.friend-grid a { display: grid; gap: 4px; color: var(--text); font-size: 13px; font-weight: 600; text-align: center; }
.friend-grid .avatar { width: 100%; height: auto; aspect-ratio: 1; }
.friend-grid .avatar img { border-radius: 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.photo-grid img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 8px; }
.user-card { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 0 12px 14px; overflow: hidden; }
.user-card-cover { display: block; width: calc(100% + 24px); height: 64px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); background-size: cover; background-position: center; }
.user-card .avatar-link { margin-top: -36px; }
.user-card .avatar img { border: 3px solid var(--surface); }
.user-card .name { color: var(--text); font-weight: 700; }
.user-card .friend-actions { margin-top: 6px; flex-wrap: wrap; justify-content: center; }

/* ---------- settings ---------- */
.layout-settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; max-width: 960px; margin: 0 auto; }
.settings-nav { display: grid; gap: 2px; padding: 8px; position: sticky; top: 80px; }
.settings-nav a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; text-decoration: none !important; }
.settings-nav a.is-active { background: var(--primary-soft); color: var(--primary); }
.settings-images { display: grid; grid-template-columns: auto 1fr; gap: 20px; margin-bottom: 20px; align-items: center; }
.settings-image { display: grid; gap: 10px; justify-items: center; }
.cover-preview { width: 100%; height: 150px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--primary), var(--primary-2)); background-size: cover; background-position: center; }

/* ---------- notifications ---------- */
.notif { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.notif:hover { background: var(--surface-2); }
.notif.is-unread { background: var(--primary-soft); }
.notif-text { display: grid; }
.notif-text small { color: var(--primary); font-weight: 600; }

/* ---------- messenger ---------- */
.messenger { display: grid; grid-template-columns: 340px 1fr; padding: 0; height: calc(100vh - 120px); min-height: 480px; overflow: hidden; }
.inbox { border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox .card-title { padding: 16px 16px 0; }
.inbox-list { overflow: auto; padding: 6px; }
.inbox-item { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.is-active { background: var(--primary-soft); }
.inbox-item.is-unread strong { color: var(--primary); }
.inbox-text { display: grid; flex: 1; min-width: 0; }
.inbox-text small { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversation { display: flex; flex-direction: column; min-height: 0; }
.conversation-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.conversation-head .name { color: var(--text); font-weight: 700; }
.conversation-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: 70%; background: var(--surface-2); padding: 8px 12px; border-radius: 18px 18px 18px 6px; overflow-wrap: anywhere; }
.bubble-row.mine .bubble { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: var(--on-primary); border-radius: 18px 18px 6px 18px; }
.bubble-row.mine .bubble a { color: inherit; text-decoration: underline; }
.bubble img { max-width: 260px; border-radius: 12px; margin-bottom: 4px; }
.bubble time { display: block; font-size: 11px; opacity: .7; text-align: end; }
.conversation-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.conversation-form textarea { resize: none; border-radius: 20px; min-height: 42px; }
.conversation-empty { margin: auto; text-align: center; color: var(--text-2); }
.conversation-empty .icon { width: 56px; height: 56px; margin: 0 auto; opacity: .4; }
.show-sm { display: none; }

/* ---------- search & communities ---------- */
.search-box { display: flex; gap: 8px; padding: 10px; }
.community-card { display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none !important; }
.community-card:hover { border-color: var(--primary); }
.community-thumb { width: 64px; height: 64px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); background-size: cover; background-position: center; }
.community-info { display: grid; gap: 2px; min-width: 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 20, .6); }
.modal-box { position: relative; background: var(--surface); border-radius: var(--radius); padding: 20px; width: min(480px, 100%); max-height: 86vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-wide .modal-box { width: auto; max-width: 96vw; padding: 0; background: #000; }
.modal-x { position: absolute; top: 8px; inset-inline-end: 8px; border: 0; background: var(--surface-2); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; z-index: 2; color: var(--text); }
.modal-title { font-size: 18px; }
.user-list { display: grid; gap: 4px; }
.lightbox { position: relative; }
.lightbox img { max-width: 96vw; max-height: 86vh; object-fit: contain; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255, 255, 255, .2); color: #fff; font-size: 34px; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; }
.lightbox-nav.prev { inset-inline-start: 10px; }
.lightbox-nav.next { inset-inline-end: 10px; }

/* ---------- auth & landing ---------- */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 15% 10%, var(--primary-soft), transparent 45%), radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--primary-2) 18%, transparent), transparent 45%), var(--bg); }
.auth-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.lang-switch button.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.auth-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.auth-card { max-width: 420px; margin: 20px auto; padding: 28px; }
.auth-card-wide { max-width: 640px; }
.auth-card h2 { font-size: 24px; }
.auth-foot { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; padding: 20px; color: var(--text-2); font-size: 13px; }
.auth-foot a { color: var(--text-2); }
.landing { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; min-height: 70vh; }
.landing-hero h1 { font-size: 64px; letter-spacing: -2px; margin: 0; background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 22px; color: var(--text-2); margin: 8px 0 28px; }
.landing-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; font-size: 17px; font-weight: 600; }
.landing-points li { display: flex; align-items: center; gap: 12px; }
.landing-points .icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.landing .auth-card { margin: 0; width: 100%; }
.req-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.req-list li { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.req-list li.ok { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.req-list li.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.req-list .icon { width: 16px; height: 16px; }
.error-card { max-width: 480px; margin: 40px auto; text-align: center; padding: 40px 24px; }
.error-code { font-size: 72px; font-weight: 900; line-height: 1; margin-bottom: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-code .icon { width: 72px; height: 72px; margin: 0 auto; color: var(--primary); }
.page-card { max-width: 820px; margin: 0 auto; padding: 32px; }
.page-body { font-size: 16px; line-height: 1.75; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-nav { display: grid; gap: 2px; padding: 8px; position: sticky; top: 80px; }
.admin-nav-title { display: flex; align-items: center; gap: 8px; font-weight: 800; padding: 10px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; text-decoration: none !important; }
.admin-nav a.is-active { background: var(--primary-soft); color: var(--primary); }
.admin-nav .pill { margin-inline-start: auto; }
.admin-main { display: grid; gap: 16px; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { display: grid; gap: 4px; }
.stat-label { color: var(--text-2); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; }
.bar-col { flex: 1; display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; color: var(--text-2); }
.bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar { width: 40%; min-height: 2px; border-radius: 4px 4px 0 0; }
.bar-a, .key-a { background: var(--primary); }
.bar-b, .key-b { background: var(--primary-2); opacity: .55; }
.legend { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-start: 8px; }
.toolbar { display: flex; gap: 8px; padding: 10px; }
.toolbar select { width: auto; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: start; vertical-align: middle; }
.table th { color: var(--text-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
.table td.actions { white-space: nowrap; text-align: end; }
.table td.actions form { margin-inline-start: 4px; }
.table select { width: auto; padding: 4px 8px; }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a { padding: 6px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.pagination a.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.report p { white-space: pre-wrap; }

/* ---------- mobile nav ---------- */
.mobile-nav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout-3 { grid-template-columns: 220px minmax(0, 1fr); }
  .side-right { display: none; }
}
@media (max-width: 900px) {
  .layout-3, .layout-2, .layout-settings, .admin, .landing { grid-template-columns: 1fr; }
  .side-left { display: none; }
  .side, .settings-nav, .admin-nav { position: static; }
  .layout-2 > .side { order: 2; }
  .settings-nav, .admin-nav { display: flex; overflow-x: auto; }
  .settings-nav a, .settings-nav-title, .admin-nav a { white-space: nowrap; }
  .admin-nav-title { display: none; }
  .landing-hero h1 { font-size: 46px; }
  .messenger { grid-template-columns: 1fr; height: calc(100vh - 140px); }
  .messenger.has-partner .inbox { display: none; }
  .messenger:not(.has-partner) .conversation { display: none; }
  .show-sm { display: inline-grid; }
}
@media (max-width: 640px) {
  .page { padding: 12px 10px 90px; }
  .topbar-inner { gap: 8px; padding: 0 10px; }
  .brand-name { display: none; }
  .topbar-search { max-width: none; }
  .topnav-link { width: 40px; }
  .hide-sm { display: none; }
  .topnav > a.topnav-link[href$="/friends"] { display: none; }
  .grid-2, .settings-images { grid-template-columns: 1fr; }
  .profile-cover { height: 180px; }
  .profile-info { padding: 0 14px 12px; margin-top: -48px; }
  .avatar-xl { width: 110px; height: 110px; }
  .profile-names h1 { font-size: 22px; }
  .card { border-radius: 12px; padding: 14px; }
  .media-grid { margin: 0 -14px; border-radius: 0; }
  .composer-actions .chip span { display: none; }
  .post-action span { display: none; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; justify-content: space-around;
    background: var(--topbar); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { position: relative; display: grid; place-items: center; width: 52px; height: 42px; color: var(--text-2); border-radius: 12px; }
  .mobile-nav a.is-active { color: var(--primary); }
  .bubble { max-width: 86%; }
}

/* ================= BysCial 2.0 components ================= */
.avatar-square img { border-radius: 22%; }
.vip-badge { display: inline-block; margin-inline-start: 5px; padding: 0 6px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; line-height: 17px; vertical-align: 2px; color: #3b2a00; background: linear-gradient(135deg, #ffe08a, #f5b700); }
.greeting { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row .chip { background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.google-btn svg { flex: none; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
code, .secret { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.secret { display: block; margin: 6px 0; padding: 8px 10px; }
.code-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 8px 0; }
.qr-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
#qrcode { background: #fff; padding: 8px; border-radius: 10px; min-width: 196px; min-height: 196px; }
.steps { padding-inline-start: 20px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 14px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; text-align: center; }
.mini-stats div { display: grid; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 4px; }
.mini-stats strong { font-size: 18px; }
.mini-stats small { color: var(--text-2); }

/* composer extras */
.composer-input { flex: 1; position: relative; display: flex; align-items: flex-start; gap: 4px; }
.composer-input textarea { flex: 1; }
.composer-previews video { width: 120px; height: 84px; border-radius: 10px; object-fit: cover; background: #000; }
.chip input[type=checkbox] { width: auto; margin: 0; }
.emoji-box { position: absolute; z-index: 40; bottom: calc(100% + 6px); inset-inline-end: 0; width: 280px; max-height: 210px; overflow: auto; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.emoji-box button { border: 0; background: none; font-size: 22px; cursor: pointer; border-radius: 8px; padding: 2px; }
.emoji-box button:hover { background: var(--surface-2); }
.comment-input { position: relative; }
.mention-box { position: absolute; z-index: 45; top: calc(100% + 4px); inset-inline-start: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 4px; display: grid; }
.mention-box button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer; text-align: start; }
.mention-box button:hover { background: var(--surface-2); }
.mention-box img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.mention-box small { color: var(--text-2); }
.gif-btn { font-size: 11px; font-weight: 800; }
.gif-preview { max-width: 140px; border-radius: 10px; margin-inline-start: 42px; }
.gif-picker { display: grid; gap: 10px; }
.gif-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 50vh; overflow: auto; }
.gif-results img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; cursor: pointer; }

/* media: video, sensitive, link cards */
.media-wrap { position: relative; margin: 0 -16px; }
.media-wrap .media-grid { margin: 0; }
.media-video { background: #000; display: grid; place-items: center; }
.media-video video { width: 100%; max-height: 560px; display: block; background: #000; }
.media-wrap.is-sensitive .media-grid { filter: blur(28px); pointer-events: none; }
.sensitive-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; border: 0; background: rgba(0,0,0,.35); color: #fff; cursor: pointer; font: inherit; }
.sensitive-cover .icon { width: 34px; height: 34px; }
.embed-video { position: relative; aspect-ratio: 16 / 9; margin: 0 -16px; background: #000; }
.embed-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.link-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; color: var(--text); text-decoration: none !important; background: var(--surface-2); }
.link-card img { width: 100%; max-height: 300px; object-fit: cover; }
.link-card-text { display: grid; gap: 2px; padding: 10px 12px; }
.link-card-text small { color: var(--text-2); font-size: 11.5px; letter-spacing: .4px; }
.link-card-text span { color: var(--text-2); font-size: 13.5px; }

/* stories */
.stories { display: flex; gap: 12px; overflow-x: auto; padding: 12px; scrollbar-width: thin; }
.story-bubble { display: grid; justify-items: center; gap: 4px; border: 0; background: none; cursor: pointer; flex: none; width: 76px; color: var(--text); }
.story-ring { position: relative; padding: 3px; border-radius: 50%; background: var(--surface-3); }
.story-bubble.is-unseen .story-ring { background: conic-gradient(from 200deg, var(--primary), var(--primary-2), #ff6a88, var(--primary)); }
.story-ring .avatar img { border: 3px solid var(--surface); }
.story-plus { position: absolute; inset-inline-end: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; border: 2px solid var(--surface); }
.story-plus .icon { width: 16px; height: 16px; }
.story-name { font-size: 12px; font-weight: 600; max-width: 76px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-viewer { position: relative; width: min(420px, 94vw); height: min(740px, 84vh); display: grid; place-items: center; overflow: hidden; background: #111; color: #fff; }
.story-image { width: 100%; height: 100%; object-fit: contain; }
.story-text { padding: 24px; font-size: 26px; font-weight: 800; text-align: center; overflow-wrap: anywhere; text-shadow: 0 2px 6px rgba(0,0,0,.35); }
.story-text.over { position: absolute; bottom: 70px; left: 0; right: 0; font-size: 20px; background: rgba(0,0,0,.35); }
.story-progress { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; z-index: 2; }
.story-progress span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; position: relative; }
.story-progress span.done { background: #fff; }
.story-progress span.run::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; animation: storybar 6s linear forwards; }
@keyframes storybar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.story-author { position: absolute; top: 20px; inset-inline-start: 12px; display: flex; align-items: center; gap: 8px; color: #fff; z-index: 2; text-decoration: none !important; }
.story-author img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.story-author small { opacity: .8; }
.story-nav { position: absolute; top: 0; bottom: 0; width: 35%; border: 0; background: transparent; cursor: pointer; z-index: 1; }
.story-nav.prev { left: 0; }
.story-nav.next { right: 0; }
.story-owner { position: absolute; bottom: 14px; display: flex; gap: 8px; z-index: 2; }

/* hover card */
.hover-card { position: absolute; z-index: 90; width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.18); overflow: hidden; }
.hover-cover { height: 70px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); background-size: cover; background-position: center; }
.hover-body { display: flex; gap: 10px; padding: 0 14px 10px; margin-top: -30px; align-items: flex-end; }
.hover-body .avatar img { border: 3px solid var(--surface); }
.hover-body .name { color: var(--text); font-weight: 800; }
.hover-actions { display: flex; gap: 6px; padding: 0 14px 14px; }

/* events */
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.event-card { padding: 0; overflow: hidden; display: grid; color: var(--text); text-decoration: none !important; }
.event-cover { position: relative; height: 120px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); background-size: cover; background-position: center; }
.event-cover .date-chip { position: absolute; inset-inline-start: 12px; bottom: -18px; }
.event-info { display: grid; gap: 3px; padding: 24px 14px 14px; }
.date-chip { display: inline-grid; place-items: center; width: 46px; height: 50px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); line-height: 1.1; flex: none; color: var(--text); }
.date-chip b { font-size: 19px; color: var(--danger); }
.date-chip small { font-size: 11px; text-transform: uppercase; font-weight: 700; }
.date-chip-lg { width: 64px; height: 70px; }
.date-chip-lg b { font-size: 28px; }
.event-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--text); text-decoration: none !important; }
.event-row span:last-child { display: grid; }
.event-head { margin-top: 12px; align-items: center; }
.invite-box summary { cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.check-list { display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.check-list .check { gap: 8px; }

/* business pages */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.video-tile { display: grid; gap: 4px; }
.video-tile video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }

/* ads */
.ad { display: grid; gap: 4px; color: var(--text); text-decoration: none !important; position: relative; }
.ad img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-sm); }
.ad-label { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

/* weather */
.weather-now { display: flex; align-items: center; gap: 10px; }
.weather-now b { font-size: 30px; }
.weather-icon { font-size: 36px; }
.weather-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; text-align: center; }
.weather-days div { display: grid; background: var(--surface-2); border-radius: 10px; padding: 6px; }
.weather-days span { font-size: 22px; }

/* games */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.game-card { display: grid; gap: 4px; justify-items: start; color: var(--text); text-decoration: none !important; transition: transform .15s; }
.game-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.game-icon { font-size: 44px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; max-width: 1000px; margin: 0 auto; }
.game-canvas-wrap { position: relative; width: min(100%, 440px); margin: 10px auto; }
.game-canvas-wrap canvas { width: 100%; height: auto; aspect-ratio: 1; display: block; border-radius: var(--radius-sm); touch-action: none; background: var(--surface-2); }
.game-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: color-mix(in srgb, var(--surface) 82%, transparent); border-radius: var(--radius-sm); text-align: center; padding: 16px; }
.game-pad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-areas: ". up ." "left down right"; gap: 6px; justify-content: center; }
.game-pad button { height: 48px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; font-size: 18px; cursor: pointer; touch-action: manipulation; }
.game-pad [data-key=ArrowUp] { grid-area: up; }
.game-pad [data-key=ArrowLeft] { grid-area: left; }
.game-pad [data-key=ArrowDown] { grid-area: down; }
.game-pad [data-key=ArrowRight] { grid-area: right; }
@media (hover: hover) and (pointer: fine) { .game-pad { display: none; } }
.leaders { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.leaders li { display: flex; align-items: center; gap: 8px; }
.rank { width: 22px; text-align: center; font-weight: 800; color: var(--text-2); }

/* calls */
.call { position: fixed; inset: 0; background: #0b0d17; color: #fff; display: grid; z-index: 10; }
.call-remote { position: relative; display: grid; place-items: center; }
.call-remote video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.call.is-connected .call-remote video { opacity: 1; }
.call.is-connected .call-who { display: none; }
.call-who { display: grid; justify-items: center; gap: 8px; text-align: center; }
.call-who .muted { color: #b8bdd8; }
.call-local { position: absolute; right: 16px; bottom: 100px; width: 160px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; border: 2px solid rgba(255,255,255,.4); background: #222; }
.call-controls { position: absolute; bottom: 24px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }
.call-controls .btn.is-off { background: #fff; color: #000; }
.incoming-call { position: fixed; z-index: 150; top: 76px; inset-inline-end: 16px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.25); animation: ring 1s ease-in-out infinite alternate; }
.incoming-call img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.incoming-call div { display: grid; }
@keyframes ring { from { transform: translateY(0); } to { transform: translateY(-3px); } }

/* seasonal effects */
.fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 120; }
.countdown-bar { position: fixed; z-index: 121; left: 50%; bottom: 76px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: linear-gradient(135deg, #ffcc33, #ff6a88); color: #2a1200; font-weight: 800; box-shadow: var(--shadow); pointer-events: none; }

@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .media-wrap, .embed-video { margin: 0 -14px; }
  .composer-actions .chip input + span { display: inline; }
  .call-local { width: 110px; bottom: 96px; }
  .incoming-call { left: 10px; right: 10px; }
}

/* ================= BysCial 3.0 components ================= */
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.feed-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.feed-tabs a { text-align: center; padding: 12px; font-weight: 700; color: var(--text-2); text-decoration: none !important; border-bottom: 3px solid transparent; }
.feed-tabs a.is-active { color: var(--text); border-bottom-color: var(--primary); background: var(--primary-soft); }
[data-theme^="manga"] .feed-tabs { border: 2px solid var(--border); box-shadow: var(--shadow); }
.memory-card { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none !important; background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.memory-card span { display: grid; }
.follow-stats { display: flex; gap: 14px; margin-top: 4px; }
.follow-stats a { color: var(--text-2); }
.follow-stats strong { color: var(--text); }
.pinned-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); display: flex; gap: 4px; align-items: center; }
.comment.is-reply { margin-inline-start: 42px; }
.comment-form.is-replying .comment-input { box-shadow: 0 0 0 2px var(--primary); }

/* Dating */
.dating-nav { justify-content: center; }
.dating-intro { text-align: center; }
.dating-hero { font-size: 64px; line-height: 1.1; }
.dating-points { list-style: none; padding: 0; display: grid; gap: 8px; text-align: start; max-width: 360px; margin: 16px auto; }
.dating-liked { text-align: center; font-weight: 700; background: linear-gradient(135deg, #fff2b0, #ffe4ee); }
.dating-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.dating-photo { position: relative; }
.dating-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; }
.dating-photo form { position: absolute; top: 4px; inset-inline-end: 4px; }
.dating-photo .icon-btn { background: rgba(0,0,0,.55); color: #fff; width: 30px; height: 30px; }
.swipe-deck { position: relative; height: min(600px, 70vh); max-width: 420px; width: 100%; margin: 0 auto; }
.swipe-card { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: #222; color: #fff; touch-action: none; user-select: none; cursor: grab; box-shadow: 0 10px 30px rgba(0,0,0,.25); border: 3px solid var(--border); }
.swipe-photos { position: absolute; inset: 0; }
.swipe-photos img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.swipe-dots { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; gap: 4px; }
.swipe-dots span { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.4); }
.swipe-dots span.on { background: #fff; }
.swipe-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 18px 18px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.swipe-info h3 { font-size: 28px; margin: 0; font-family: "Mitr", var(--font); }
.swipe-info h3 span { font-weight: 400; }
.swipe-info p { margin: 4px 0; }
.swipe-about { font-size: 14px; opacity: .9; max-height: 4.5em; overflow: hidden; }
.swipe-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.swipe-tags span { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; }
.swipe-report { position: absolute; top: 18px; inset-inline-end: 12px; border: 0; background: rgba(0,0,0,.4); color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.swipe-stamp { position: absolute; top: 40px; padding: 6px 14px; border: 4px solid; border-radius: 10px; font: 900 34px "Bangers", sans-serif; letter-spacing: 2px; opacity: 0; transition: opacity .1s; z-index: 2; }
.swipe-stamp.like { left: 20px; color: #2fd17a; border-color: #2fd17a; transform: rotate(-14deg); }
.swipe-stamp.nope { right: 20px; color: #ff4f6d; border-color: #ff4f6d; transform: rotate(14deg); }
.swipe-stamp.superstamp { left: 50%; top: 45%; transform: translateX(-50%); color: #3db6ff; border-color: #3db6ff; }
.swipe-card.show-like .like, .swipe-card.show-nope .nope, .swipe-card.show-super .superstamp { opacity: 1; }
.swipe-super-badge { position: absolute; top: 18px; left: 12px; background: #3db6ff; color: #fff; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 13px; z-index: 2; }
.swipe-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: var(--text-2); }
.swipe-actions { display: flex; justify-content: center; gap: 22px; }
.swipe-btn { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--border); background: var(--surface); font-size: 28px; cursor: pointer; box-shadow: 3px 3px 0 var(--border); transition: transform .1s; }
.swipe-btn:hover { transform: scale(1.08); }
.swipe-btn.pass { color: #ff4f6d; }
.swipe-btn.like { color: #2fd17a; }
.swipe-btn.super { color: #3db6ff; width: 54px; height: 54px; font-size: 22px; align-self: center; }
.match-pop { text-align: center; display: grid; gap: 12px; justify-items: center; }
.match-pop h2 { font: 400 46px "Bangers", "Mitr", sans-serif; letter-spacing: 2px; background: linear-gradient(135deg, #ff4f8b, #d4a017); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.match-pop img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid #d4a017; }
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.match-card { display: grid; gap: 4px; text-align: center; }
.match-card a { display: grid; gap: 4px; color: var(--text); text-decoration: none !important; }
.match-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; border: 2px solid var(--border); }

/* Arcade */
.game-card { position: relative; }
.game-tags { display: flex; gap: 4px; position: absolute; top: 12px; inset-inline-end: 12px; }
.pill-soft { background: var(--surface-2); color: var(--text-2); }
.game-hud { display: flex; gap: 14px; font-weight: 700; }
.arcade-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; max-height: 72vh; margin: 10px auto; border-radius: var(--radius-sm); overflow: hidden; background: #111; border: 2px solid var(--border); touch-action: none; }
.arcade-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.game-overlay-icon { font-size: 58px; }
.fps-hud { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.crosshair { width: 26px; height: 26px; position: relative; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: #fff; box-shadow: 0 0 0 1px #000; }
.crosshair::before { left: 12px; top: 0; width: 2px; height: 26px; }
.crosshair::after { top: 12px; left: 0; width: 26px; height: 2px; }
.fps-hud.flash { background: radial-gradient(circle, rgba(255,240,180,.35), transparent 30%); }
.fps-hint { position: absolute; bottom: 14px; background: rgba(0,0,0,.6); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; }
.coin-game { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: radial-gradient(circle at 50% 40%, #3a2c55, #15111f); color: #fff; }
.coin-scene { perspective: 700px; }
.coin { width: 150px; height: 150px; position: relative; transform-style: preserve-3d; transition: transform 1.25s cubic-bezier(.2, .7, .2, 1); }
.coin-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-content: center; justify-items: center; font-size: 56px; backface-visibility: hidden; background: radial-gradient(circle at 35% 30%, #fff2b0, #f3c64c 45%, #b8860b); border: 5px solid #8a5f00; box-shadow: inset 0 0 0 6px rgba(255,255,255,.25); color: #5a3d00; }
.coin-face small { font-size: 14px; font-weight: 800; }
.coin-face.tails { transform: rotateX(180deg); }
.coin-msg { font-size: 20px; font-weight: 700; min-height: 1.5em; margin: 0; }
.coin-buttons { display: flex; gap: 12px; }

/* ================= BysCial 3.1 Groups ================= */
.group-cover { height: 320px; }
.group-info { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 16px 24px; flex-wrap: wrap; }
.group-title h1 { font-size: 30px; margin: 0; }
.group-slogan { margin: 2px 0 6px; color: var(--text-2); font-style: italic; }
.group-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--text-2); font-size: 14px; }
.group-meta a { color: var(--text-2); }
.group-meta strong { color: var(--text); }
.privacy-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--surface-2); border: 1.5px solid var(--border); color: var(--text); }
.privacy-badge.is-private { background: #fff1d6; color: #7a4b00; }
.privacy-badge.is-public { background: #dff5ff; color: #00527a; }
[data-theme="manga_night"] .privacy-badge.is-private, [data-theme="midnight"] .privacy-badge.is-private, [data-theme="synthwave"] .privacy-badge.is-private { background: #3d2c0b; color: #ffd27a; }
[data-theme="manga_night"] .privacy-badge.is-public, [data-theme="midnight"] .privacy-badge.is-public, [data-theme="synthwave"] .privacy-badge.is-public { background: #0b2f3d; color: #9fe1ff; }
.avatar-stack { display: flex; margin-top: 8px; }
.avatar-stack .avatar-link { margin-inline-end: -8px; }
.avatar-stack .avatar img { border: 2px solid var(--surface); }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.admin-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; border-radius: var(--radius-sm); background: var(--primary-soft); border: 1.5px dashed var(--primary); }
.group-tabs a.admin-tab { color: var(--primary); }
.group-rules ol, .rules-full { padding-inline-start: 20px; margin: 0; display: grid; gap: 8px; }
.group-rules li, .rules-full li { display: grid; }
.member-row { padding: 8px 0; border-bottom: 1px solid var(--surface-3); }
.member-row:last-child { border-bottom: 0; }
.badge-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.group-badge { display: inline-flex; gap: 3px; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); }
.gb-admin { background: #ffe4ee; color: #a3124b; }
.gb-moderator { background: #e3f3ff; color: #00527a; }
.gb-founding { background: #e6f7e6; color: #1d6b2a; }
.gb-expert { background: #f0e6ff; color: #5a2ca0; }
.gb-rising { background: #fff4cc; color: #7a5a00; }
.file-list { display: grid; gap: 8px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.file-icon { font-size: 26px; }
.file-meta { display: grid; flex: 1; min-width: 0; }
.file-name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.sub-tabs { margin-bottom: 12px; }
.request-card { padding: 14px 0; border-bottom: 1px solid var(--surface-3); display: grid; gap: 8px; }
.answers { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); display: grid; gap: 2px; }
.answers dt { font-weight: 700; font-size: 13px; color: var(--text-2); }
.answers dd { margin: 0 0 6px; }
.pending-post { display: grid; gap: 0; }
.pending-post .post { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pending-actions { border-top-left-radius: 0; border-top-right-radius: 0; padding: 10px 16px; }
.post.is-announcement { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow); }
.announce-label { font-weight: 800; color: var(--primary); font-size: 13px; }
.anon-avatar { display: inline-grid; place-items: center; font-size: 22px; background: var(--surface-3); border-radius: 50%; }
.comments-off { padding: 6px 0; }
.dropdown-label { padding: 4px 10px; font-size: 12px; font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.composer-group-options { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 8px 10px; background: var(--primary-soft); border-radius: var(--radius-sm); }
.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.option-card { display: flex !important; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500 !important; }
.option-card input { width: auto; margin-top: 4px; }
.option-card span { display: grid; gap: 2px; }
.option-card small { color: var(--text-2); font-weight: 400; }
.option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.switch { display: flex !important; align-items: center; gap: 10px; cursor: pointer; font-weight: 500 !important; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider { position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1.5px solid var(--border); transition: background .15s; }
.switch .slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; border: 1px solid var(--border); transition: transform .15s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--primary-soft); }
.switch-sm .slider { width: 36px; height: 20px; }
.switch-sm .slider::after { width: 13px; height: 13px; }
.switch-sm input:checked + .slider::after { transform: translateX(16px); }
.input-prefix { display: flex; align-items: center; gap: 4px; }
.input-prefix small { white-space: nowrap; color: var(--text-2); }
.crud-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.crud-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); font-weight: 800; flex: none; }
.crud-edit { display: flex; gap: 6px; flex: 1; }
.rule-card .form { gap: 8px; }
.admin-nav-group { padding: 10px 10px 2px; font-size: 12px; font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.group-admin { max-width: 1180px; margin: 0 auto; }
.reported-content { margin: 8px 0; padding: 10px 12px; border-inline-start: 4px solid var(--danger); background: var(--surface-2); border-radius: 6px; }
.inline-select { display: flex; gap: 6px; align-items: center; }
.inline-select select { width: auto; max-width: 200px; padding: 5px 8px; }
.top-post { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); text-decoration: none !important; border-bottom: 1px solid var(--surface-3); }
.top-post-text { display: grid; flex: 1; min-width: 0; }
.top-post-text small { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .group-cover { height: 170px; }
  .group-info { padding: 12px 14px; }
  .group-title h1 { font-size: 22px; }
  .group-actions { justify-content: flex-start; }
}

/* ===== v3.2 Pages / Ads / Verification ===== */
.btn-gold { background: linear-gradient(135deg, #f7d774, #d4a017 55%, #b8860b); color: #2b1d00; border: 0; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-block { width: 100%; justify-content: center; }
.visitor-banner, .acting-banner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.visitor-banner { background: var(--warn); color: #241a00; padding: 8px 16px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 600; }
.acting-banner form { margin: 0; }
.acting-banner .btn { color: inherit; border-color: currentColor; }
.invite-banner { padding: 12px 16px; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; border-inline-start: 4px solid var(--primary); }
.invite-banner form { display: inline; }
.page-actions { flex-wrap: wrap; gap: 6px; }
.page-actions form { margin: 0; }
.page-admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.page-admin-toolbar form { margin: 0; }
.page-admin-toolbar > span:first-child { margin-inline-end: auto; }
.page-tabs { overflow-x: auto; scrollbar-width: thin; }
.page-tabs a { white-space: nowrap; }
.page-tabs .admin-tab { color: var(--primary); }
.open-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: middle; }
.open-badge.is-open { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.open-badge.is-closed { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.map-embed { margin-top: 10px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 4 / 3; }
.map-embed.map-lg { aspect-ratio: 16 / 9; }
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.hours-table, .hours-edit { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours-table td { padding: 4px 0; }
.hours-table td:last-child { text-align: end; color: var(--text-2); }
.hours-table tr.is-today td { font-weight: 700; color: var(--primary); }
.hours-edit td { padding: 4px 6px 4px 0; vertical-align: middle; }
.hours-edit input[type=time] { width: auto; }
.hours-edit input[type=checkbox] { width: auto; }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; flex: 1; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: inherit; transition: width .4s; }
.progress-lg { height: 14px; }
.verify-widget .progress { margin: 8px 0 4px; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.st-active, .st-approved, .st-paid { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.st-pending, .st-pending_payment, .st-scheduled { background: color-mix(in srgb, var(--warn) 22%, transparent); color: color-mix(in srgb, var(--warn) 60%, var(--text)); }
.st-rejected, .st-failed { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.st-paused, .st-draft, .st-none { background: var(--surface-3); color: var(--text-2); }
.st-completed { background: var(--primary-soft); color: var(--primary); }
.rating-summary { text-align: center; }
.rating-big { font-size: 48px; font-weight: 800; line-height: 1; }
.stars { color: #f5b301; letter-spacing: 2px; }
.rating-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; text-align: start; }
.rating-row > span:first-child { min-width: 64px; }
.rating-row small { min-width: 32px; text-align: end; color: var(--text-2); }
.review { padding: 14px 16px; }
.review .user-row .stars { margin-inline-start: auto; }
.review p { margin: 8px 0 0; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 32px; color: var(--surface-3); cursor: pointer; transition: color .15s, transform .15s; margin: 0; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f5b301; }
.star-input label:hover { transform: scale(1.15); }
.star-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.album-card { display: grid; gap: 4px; color: inherit; text-decoration: none; }
.album-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); box-shadow: 4px 4px 0 var(--surface-3); transition: transform .2s; }
.album-card:hover img { transform: translateY(-2px); }
.reels { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.reels .video-tile { display: grid; gap: 4px; }
.reels video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; border-radius: var(--radius-sm); }
.post-cta { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 16px; padding: 8px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-weight: 700; text-decoration: none; }
.post-cta:hover { filter: brightness(.97); }
.boost-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--border); }
.sponsored-wrap { position: relative; margin-bottom: 16px; }
.sponsored-label { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 0 4px 4px; }
.sponsored-wrap > .post { margin-bottom: 0; }
.sponsored-cta { margin-top: 6px; }
.short-ad .short-stage { background: linear-gradient(160deg, #3b2a6b, #111); }
.short-ad .short-info { inset-inline-end: 0; }
.short-ad-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.short-ad-label { font-size: 12px; font-weight: 700; opacity: .9; margin-bottom: 6px; }
.short-ad-cta { margin-top: 10px; }
.slip-check { display: grid; gap: 4px; margin: 8px 0; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid var(--border); }
.pay-rejected { margin: 6px 0; font-size: 13px; color: var(--danger); }
.pay-reject summary { list-style: none; cursor: pointer; margin-top: 6px; }
.pay-reject form { display: grid; gap: 6px; margin-top: 6px; }
.slip-check ul { margin: 0; padding-inline-start: 18px; }
.slip-check.is-verified { background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.slip-check.is-suspicious { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }
.post-lock { display: grid; gap: 6px; justify-items: start; margin: 8px 0; padding: 16px; border-radius: var(--radius-sm); border: 1px dashed var(--border); background: var(--primary-soft); }
.post-lock p { margin: 0; }
.short-locked-img { filter: blur(14px) brightness(.7); transform: scale(1.1); }
.short-locked .post-lock { color: var(--text); }
.paid-fields { display: grid; gap: 6px; }
.paid-fields summary { list-style: none; cursor: pointer; width: fit-content; }
.member-badge { margin-inline-start: 4px; font-size: 13px; }
.tier-list { display: grid; gap: 10px; }
.tier { display: grid; gap: 6px; }
.tier-edit { padding: 10px 0; border-bottom: 1px solid var(--border); }
.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.stars { color: #f5a524; letter-spacing: 1px; }
.market-seller-head { display: flex; gap: 16px; align-items: center; }
.review { padding: 12px 0; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.review:first-child { border-top: 0; }
.review.is-hidden { opacity: .5; }
.review p { margin: 0; }
.review-reply { margin: 0; padding: 8px 10px; border-inline-start: 3px solid var(--primary); background: var(--primary-soft); border-radius: var(--radius-sm); }
.review-reply-form { display: flex; gap: 6px; }
.review-reply-form input { flex: 1; }
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; border: 0; padding: 0; margin: 0; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 28px; color: var(--border); cursor: pointer; padding: 0 2px; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f5a524; }
.star-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }
.market-p2p { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text); }
.market-side { display: grid; gap: 12px; position: sticky; top: 76px; align-self: start; min-width: 0; }
.market-side .market-filters { position: static; }
.market-alert-form { display: grid; gap: 6px; }
.saved-searches { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.saved-searches li { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
@media (max-width: 860px) { .market-side { position: static; } }
.market-sold.is-reserved { background: var(--warn); color: #241a00; }
.market-approx { font-size: 12px; font-weight: 500; color: var(--text-2); }
.market-ad-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.story-ad .story-text b { font-size: 1.15em; }
.ad-review { display: grid; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.ad-review-creative { display: flex; gap: 12px; align-items: flex-start; }
.ad-review-creative img { width: 120px; max-height: 120px; object-fit: cover; border-radius: 10px; flex: none; }
.ad-review-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-review-actions input { flex: 1 1 220px; }
.ad-adjust summary { list-style: none; cursor: pointer; }
.text-warn { color: color-mix(in srgb, var(--warn) 75%, var(--text)); }
.ad-adjust[open] form { margin-top: 8px; min-width: 220px; }
.ad-feed { display: grid; gap: 8px; padding: 14px; color: inherit; text-decoration: none; }
.ad-feed img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius-sm); }
.ad-feed .btn { justify-self: start; }
.page-publisher { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; }
.identity-switch { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 600; }
.identity-switch select { width: auto; padding: 4px 8px; }
.page-publisher .check { margin: 0; }
.album-input { max-width: 200px; padding: 4px 8px; }
.publish-schedule { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.publish-schedule input { width: auto; }
.publish-split { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.ad-wizard { display: grid; gap: 16px; }
.ad-wizard .step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 14px; margin-inline-end: 6px; }
.boost-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; max-height: 360px; overflow-y: auto; }
.boost-option { display: block !important; cursor: pointer; margin: 0; }
.boost-option input { position: absolute; opacity: 0; width: 1px; }
.boost-option > span { display: grid; gap: 4px; height: 100%; padding: 8px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-weight: 400; }
.boost-option img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }
.boost-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.boost-option input:focus-visible + span { outline: 2px solid var(--primary); }
.estimate-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.estimate-box > div { display: grid; gap: 2px; }
.estimate-box strong { font-size: 20px; }
.estimate-box .total { color: var(--primary); }
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip-check { border: 1px solid var(--border); background: var(--surface); }
.chip-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.faq-buttons { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); }
.faq-buttons form { margin: 0; }
.faq-buttons .chip { border: 1px solid var(--primary); color: var(--primary); }
.faq-row { padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.role-help { margin: 0 0 12px; padding-inline-start: 18px; color: var(--text-2); font-size: 14px; display: grid; gap: 4px; }
.bar-c, .key-c { background: var(--success); }
.bar-chart-sm { height: 120px; gap: 2px; }
.queue-meta { display: flex; align-items: center; gap: 8px; margin: 0 4px 6px; font-size: 13px; }
.about-card h3 { margin-top: 18px; }
.page-chat { max-width: 720px; margin: 0 auto; }
@media (max-width: 640px) {
  .page-admin-toolbar > span:first-child { flex-basis: 100%; }
  .estimate-box strong { font-size: 17px; }
  .album-input { max-width: none; flex: 1; }
}

/* ===== v3.3 Settings & profile management ===== */
.settings-nav-title { display: flex; align-items: center; gap: 8px; padding: 6px 10px 10px; font-weight: 800; font-size: 15px; }
.settings-nav a > span { display: grid; line-height: 1.25; }
.settings-nav a small { font-weight: 400; font-size: 12px; color: var(--text-2); }
.settings-nav a.is-active small { color: inherit; opacity: .8; }
.settings-nav hr { margin: 6px 0; border: 0; border-top: 1px solid var(--border); }
.settings-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 10px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.settings-list { display: grid; gap: 0; }
.setting-toggle, .setting-select { display: flex !important; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); font-weight: 400 !important; cursor: pointer; }
.settings-list .card-title + .setting-toggle, .settings-list .card-title + .setting-select { border-top: 0; }
.setting-toggle > span:first-child, .setting-select > span:first-child { display: grid; gap: 2px; }
.setting-select select { width: auto; min-width: 180px; max-width: 50%; }
.setting-toggle .switch { flex: none; }
.badge-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: middle; margin-inline-start: 6px; }
.badge-status.is-ok { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.badge-status.is-warn { background: color-mix(in srgb, var(--warn) 25%, transparent); color: color-mix(in srgb, var(--warn) 55%, var(--text)); }
.status-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 10px 0; }
.status-row + .status-row { border-top: 1px solid var(--border); }
.flash-warn { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.char-count { display: block; text-align: end; font-variant-numeric: tabular-nums; }
.char-count.is-near { color: var(--danger); font-weight: 700; }
.field-with-vis { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 12px; align-items: end; }
.vis-select { font-size: 14px; }
.link-list { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.link-row .icon-btn { width: 36px; height: 36px; }
.social-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.social-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none !important; }
.social-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.social-link:hover { background: var(--primary-soft); color: var(--primary); }
.link-icon { width: 16px; height: 16px; flex: none; }
.real-name { color: var(--text-2); font-size: 14px; margin-top: -2px; }
.pronouns { font-weight: 600; }
.private-lock { color: var(--text-2); }
.private-notice .icon { width: 48px; height: 48px; }
.follow-req-banner { display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 12px; font-weight: 700; text-decoration: none !important; color: var(--text); }
.request-row { padding: 10px 0; border-top: 1px solid var(--border); gap: 8px; }
.request-row form { margin: 0; }
.tabs-inline { padding: 0; border-top: 0; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 4px 0; }
.segmented legend { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.segmented label { display: inline-flex !important; margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--border); font-weight: 600; font-size: 14px; }
.segmented input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); }
.oauth-buttons { display: grid; gap: 8px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.oauth-btn.oauth-apple { background: #000; color: #fff; border-color: #000; }
.oauth-btn.oauth-facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.oauth-cards { display: grid; gap: 10px; }
.oauth-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); }
.oauth-card.is-connected { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); }
.oauth-card form { margin: 0; }
.oauth-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); flex: none; }
.oauth-logo .oauth-icon { width: 22px; height: 22px; }
.oauth-info { display: grid; flex: 1; min-width: 0; }
.oauth-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strength { display: grid; gap: 4px; }
.strength-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.strength-bar span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .25s, background .25s; background: var(--danger); }
.strength[data-level="1"] .strength-bar span { background: #f08c00; }
.strength[data-level="2"] .strength-bar span { background: var(--warn); }
.strength[data-level="3"] .strength-bar span, .strength[data-level="4"] .strength-bar span { background: var(--success); }
.danger-zone { border: 1.5px solid color-mix(in srgb, var(--danger) 45%, var(--border)); }
.danger-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.danger-item p { margin: 2px 0 0; }
.danger-details summary { cursor: pointer; color: var(--danger); font-weight: 600; padding: 8px 0; }
.recovery-box { padding: 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--success) 10%, var(--surface)); border: 1.5px dashed color-mix(in srgb, var(--success) 50%, transparent); margin-bottom: 14px; }
.recovery-box .code-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.recovery-box code { font-size: 15px; letter-spacing: 1px; padding: 6px; text-align: center; background: var(--surface); border-radius: 6px; }
.device-list { display: grid; gap: 4px; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.device form { margin: 0; }
.device-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); flex: none; }
.device.is-current .device-icon { background: var(--primary-soft); color: var(--primary); }
.device-info { display: grid; flex: 1; min-width: 0; gap: 1px; }
.token-row { padding: 10px 0; border-top: 1px solid var(--border); }
.token-row .user-row-text { display: grid; }
.token-create { margin-top: 12px; }
.token-create summary { list-style: none; display: inline-flex; }
.token-create summary::-webkit-details-marker { display: none; }
.token-create[open] summary { margin-bottom: 10px; }
.scope-list { display: grid; gap: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.scope-list legend { font-weight: 700; padding: 0 4px; }
.notify-matrix { width: 100%; border-collapse: collapse; }
.notify-matrix th, .notify-matrix td { padding: 12px 8px; border-top: 1px solid var(--border); text-align: center; vertical-align: middle; }
.notify-matrix thead th { border-top: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.notify-matrix tbody th { text-align: start; display: flex; gap: 10px; align-items: center; font-weight: 400; }
.notify-matrix tbody th > span:last-child { display: grid; }
.notify-matrix .switch { justify-content: center; }
.nm-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); flex: none; font-weight: 800; }
.seen-mark { text-align: end; font-size: 11px; color: var(--text-2); margin: -4px 6px 6px; }
.cropper { display: grid; gap: 12px; }
.cropper-stage { position: relative; width: 100%; overflow: hidden; background: #111 repeating-conic-gradient(#222 0 25%, #1a1a1a 0 50%) 0 0 / 20px 20px; border-radius: var(--radius-sm); touch-action: none; cursor: grab; user-select: none; }
.cropper-stage:active { cursor: grabbing; }
.cropper-stage:focus-visible { outline: 3px solid var(--primary); }
.cropper-avatar { aspect-ratio: 1; max-width: 360px; margin: 0 auto; }
.cropper-cover { aspect-ratio: 16 / 5; }
.cropper-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 50% 50%; pointer-events: none; }
.cropper-mask { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.cropper-stage.is-round .cropper-mask { border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(255, 255, 255, .8); }
.cropper-animated { width: 100%; height: 100%; object-fit: cover; }
.cropper-stage.is-round .cropper-animated { border-radius: 50%; }
.cropper-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cropper-zoom { display: flex !important; align-items: center; gap: 10px; flex: 1; margin: 0; }
.cropper-zoom input { flex: 1; }
@media (max-width: 640px) {
  .field-with-vis, .link-row { grid-template-columns: 1fr; }
  .link-row { grid-template-columns: minmax(0, 1fr) auto; }
  .link-row select { grid-column: 1 / -1; }
  .setting-toggle, .setting-select { align-items: flex-start; }
  .setting-select { flex-direction: column; }
  .setting-select select { max-width: none; width: 100%; }
  .danger-item { flex-direction: column; align-items: stretch; }
  .notify-matrix thead { display: none; }
  .notify-matrix tbody tr { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); padding: 8px 0; }
  .notify-matrix tbody th { grid-column: 1 / -1; border: 0; padding: 4px 0; }
  .notify-matrix td { border: 0; padding: 4px; font-size: 12px; }
  .notify-matrix td::before { content: attr(data-label); display: block; color: var(--text-2); margin-bottom: 4px; }
  .settings-nav a small { display: none; }
  .settings-nav-title, .settings-nav hr { display: none; }
}

/* ===== v3.4 BYSshort ===== */
.short-badge { display: inline-flex; align-items: center; gap: 4px; margin: 0 16px 6px; padding: 3px 10px; border-radius: 999px; background: linear-gradient(135deg, #ff2d55, #a020f0); color: #fff !important; font-size: 12px; font-weight: 700; text-decoration: none !important; }
.media-video.is-short video { aspect-ratio: 9 / 16; max-height: 560px; width: auto; margin: 0 auto; display: block; background: #000; }
.shorts-page { max-width: 560px; margin: 0 auto; }
.shorts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.shorts-title { margin: 0; font-size: 22px; }
.shorts-feed { height: calc(100vh - 150px); height: calc(100dvh - 150px); overflow-y: auto; scroll-snap-type: y mandatory; border-radius: var(--radius); outline: none; scrollbar-width: none; }
.shorts-feed::-webkit-scrollbar { display: none; }
.short { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; padding: 6px 0; }
.short-stage { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; border-radius: 16px; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.short-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.short-tap { position: absolute; inset: 0 70px 0 0; z-index: 1; cursor: pointer; }
.short-paused, .short-heart { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; pointer-events: none; z-index: 2; opacity: 0; }
.short-paused { font-size: 54px; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.short.is-paused .short-paused { opacity: .9; }
.short-heart { font-size: 96px; color: #ff2d55; }
.short.show-heart .short-heart { animation: shortHeart .8s ease-out; }
@keyframes shortHeart { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }
.short-info { position: absolute; inset-inline-start: 0; inset-inline-end: 64px; bottom: 0; padding: 60px 14px 16px; z-index: 2; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); pointer-events: none; }
.short-info a, .short-info button, .short-info form { pointer-events: auto; }
.short-info a { color: #fff; }
.short-creator { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.short-avatar img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; display: block; }
.short-name { font-weight: 800; text-decoration: none !important; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.verified-mini { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #1d9bf0; font-size: 9px; }
.short-follow { background: transparent; color: #fff; border: 1.5px solid #fff; border-radius: 8px; }
.short-follow:hover { background: #fff; color: #000; }
.short-following { font-size: 12px; opacity: .85; }
.short-creator form { margin: 0; }
.short-caption { font-size: 14px; line-height: 1.4; max-height: 2.8em; overflow: hidden; cursor: pointer; pointer-events: auto; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.short-caption.is-open { max-height: 40vh; overflow-y: auto; }
.short-caption a { color: #fff; font-weight: 700; }
.short-sound { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.short-disc { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #222; border: 3px solid #555; animation: spin 4s linear infinite; }
.short.is-paused .short-disc, .short:not(.is-active) .short-disc { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
.short-sound-text { overflow: hidden; white-space: nowrap; max-width: 70%; }
.short-sound-text span { display: inline-block; padding-left: 100%; animation: marquee 9s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.short-actions { position: absolute; inset-inline-end: 6px; bottom: 18px; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.short-act { display: grid; justify-items: center; gap: 2px; border: 0; background: none; color: #fff; cursor: pointer; padding: 0; text-shadow: 0 1px 3px rgba(0,0,0,.6); font: inherit; }
.short-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.35); font-size: 22px; transition: transform .15s; }
.short-act:hover .short-ico { transform: scale(1.08); }
.short-act:focus-visible .short-ico { outline: 3px solid #fff; }
.short-act small { font-size: 12px; font-weight: 700; }
.short-act[data-short-like] .short-ico { color: #fff; }
.short-act[data-short-like].is-on .short-ico { color: #ff2d55; background: rgba(255,255,255,.9); }
.short-act[data-short-save].is-on .short-ico { background: #f5b301; }
.short-views { color: #fff; font-size: 11px; opacity: .85; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.short-empty { color: var(--text-2); }
.shorts-hint { text-align: center; margin-top: 6px; }
.sheet { position: fixed; inset: 0; z-index: 90; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-panel { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%); max-height: 72vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow); animation: sheetUp .22s ease-out; }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 12px; }
.sheet-form { display: flex; gap: 8px; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.sheet-form input { flex: 1; }
.short-publisher { max-width: 980px; margin: 0 auto; }
.publisher-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.publisher-preview { position: sticky; top: 80px; }
.video-drop { display: grid !important; place-items: center; aspect-ratio: 9 / 16; border: 2px dashed var(--border); border-radius: 14px; background: var(--surface-2); cursor: pointer; overflow: hidden; position: relative; margin: 0; }
.video-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.video-drop:has(video:not([hidden])) input[type=file] { inset: auto 0 0 0; height: 0; }
.video-drop-sm { aspect-ratio: auto; min-height: 220px; }
.video-drop-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 16px; pointer-events: none; }
.video-drop-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 26px; }
.publisher-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cover-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.cover-thumb { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; line-height: 0; }
.cover-thumb canvas { border-radius: 4px; }
.cover-thumb.is-on { border-color: var(--primary); }
.cover-current { display: flex; align-items: flex-end; gap: 10px; }
.cover-current canvas { border-radius: 8px; background: #000; max-width: 120px; height: auto; }
.upload-progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .2s; }

/* ===== v3.4 Stories 2.0 ===== */
.story-viewer { display: block; container-type: inline-size; touch-action: pan-y; user-select: none; }
.story-viewer.has-media { background: #000; }
.story-frame { position: absolute; inset: 0; display: grid; place-items: center; }
.story-media { width: 100%; height: 100%; object-fit: contain; }
.story-progress span i { position: absolute; inset: 0 auto 0 0; width: 0; background: #fff; display: block; }
.story-progress span.done i { width: 100%; }
.story-head { position: absolute; top: 18px; left: 10px; right: 8px; display: flex; align-items: center; gap: 4px; z-index: 4; }
.story-head .story-author { position: static; flex: 1; min-width: 0; }
.story-ctrl { border: 0; background: rgba(0,0,0,.3); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.story-nav { z-index: 2; }
.story-overlays { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.story-overlays form, .story-overlays input, .story-overlays button { pointer-events: auto; }
.story-ov { position: absolute; transform: translate(-50%, -50%); max-width: 86%; text-align: center; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; text-shadow: 0 2px 6px rgba(0,0,0,.45); white-space: pre-wrap; }
.story-ov.has-bg { background: rgba(0,0,0,.45); padding: .15em .45em; border-radius: .3em; }
.story-ov-sticker { text-shadow: none; line-height: 1; }
.story-ov-question { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #fff; color: #111; text-shadow: none; font-size: 15px; min-width: 60%; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.story-ov-question small { font-weight: 400; color: #888; font-size: 12px; background: #f1f1f1; border-radius: 8px; padding: 6px; }
.story-ov-question input { font-size: 14px; }
.story-reply { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 10px; display: grid; gap: 8px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.story-quick { display: flex; justify-content: center; gap: 8px; }
.story-quick button { border: 0; background: rgba(255,255,255,.15); border-radius: 50%; width: 38px; height: 38px; font-size: 20px; cursor: pointer; transition: transform .15s; }
.story-quick button:hover, .story-quick button.is-sent { transform: scale(1.2); }
.story-reply-form { display: flex; gap: 6px; }
.story-reply-form input { flex: 1; border-radius: 999px; background: rgba(0,0,0,.4); color: #fff; border: 1.5px solid rgba(255,255,255,.7); }
.story-reply-form input::placeholder { color: rgba(255,255,255,.75); }
.story-owner { left: 50%; transform: translateX(-50%); z-index: 4; }
.story-drawer { position: absolute; left: 0; right: 0; bottom: 0; max-height: 60%; z-index: 5; display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: 16px 16px 0 0; animation: sheetUp .2s ease-out; }
.story-drawer header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.story-drawer .story-ctrl { background: var(--surface-2); color: var(--text); }
.story-drawer-body { overflow-y: auto; padding: 6px 12px; }
.story-viewer-row { padding: 8px 0; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.story-reply-tag { display: block; font-size: 11px; opacity: .75; margin-bottom: 2px; }
.story-editor { display: grid; gap: 10px; width: min(420px, 90vw); }
.story-canvas { position: relative; aspect-ratio: 9 / 16; max-height: 52vh; margin: 0 auto; width: 100%; max-width: calc(52vh * 9 / 16); border-radius: 14px; overflow: hidden; display: grid; place-items: center; container-type: inline-size; background-color: #222; }
.story-canvas img, .story-canvas video { width: 100%; height: 100%; object-fit: cover; }
.story-layer { position: absolute; inset: 0; }
.story-layer .story-ov { cursor: grab; touch-action: none; user-select: none; }
.story-layer .story-ov:focus-visible { outline: 2px dashed #fff; }
.story-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.story-tools input[type=color] { width: 36px; height: 32px; padding: 2px; border-radius: 8px; }
.story-stickers { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.story-stickers button { border: 0; background: var(--surface-2); border-radius: 8px; font-size: 22px; padding: 4px; cursor: pointer; }

/* ===== v3.4 BYSBusiness ===== */
.biz { display: grid; gap: 14px; }
.biz-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.biz-brand { display: flex; align-items: center; gap: 6px; font-size: 18px; color: var(--text); text-decoration: none !important; }
.biz-brand b { color: var(--primary); }
.biz-page-btn { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; color: var(--text); font: inherit; }
.biz-page-btn > span { display: grid; text-align: start; line-height: 1.2; }
.biz-page-btn small { color: var(--text-2); font-size: 11px; }
.biz-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.biz-nav { display: grid; gap: 2px; padding: 8px; position: sticky; top: 80px; }
.biz-nav a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; text-decoration: none !important; }
.biz-nav a:hover { background: var(--surface-2); }
.biz-nav a.is-active { background: var(--primary-soft); color: var(--primary); }
.biz-nav a > span:first-of-type { flex: 1; }
.biz-main { min-width: 0; display: grid; gap: 14px; align-content: start; }
.biz-main > .page-title { margin: 0; }
.biz-tabs { margin-bottom: 0; }
.biz-grid { gap: 14px; }
.stat-link { color: inherit; text-decoration: none !important; }
.stat-link:hover { border-color: var(--primary); }
.stat-delta { color: var(--success); font-weight: 700; }
.biz-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.biz-row:first-of-type { border-top: 0; }
.biz-row-text { flex: 1; min-width: 0; display: grid; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-row-stats { color: var(--text-2); font-size: 13px; white-space: nowrap; }
.biz-home { max-width: 900px; margin: 0 auto; display: grid; gap: 12px; }
.biz-page-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.biz-page-card { display: flex; align-items: center; gap: 12px; padding: 14px; color: inherit; text-decoration: none !important; }
.biz-page-card:hover { border-color: var(--primary); }
.biz-page-card-text { display: grid; flex: 1; min-width: 0; }
.biz-page-card-badges { display: flex; gap: 4px; }
.planner-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.planner-side { display: grid; gap: 14px; }
.planner-cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.planner-cal-head h3 { margin: 0; flex: 1; text-align: center; }
.planner-legend { margin: 0 0 8px; }
.key-pub { background: var(--success); }
.key-sch { background: var(--primary); }
.key-draft { background: var(--surface-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-2); padding: 4px 0; }
.cal-day { min-height: 96px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; display: grid; align-content: start; gap: 3px; background: var(--surface); }
.cal-day.is-out { opacity: .45; }
.cal-day.is-past { background: var(--surface-2); }
.cal-day.is-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; }
.cal-add { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--primary); text-decoration: none !important; opacity: 0; transition: opacity .15s; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-item { display: block; font-size: 11px; padding: 2px 5px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none !important; }
.cal-item.is-pub { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.cal-item.is-sch { background: var(--primary-soft); color: var(--primary); }
.planner-edit { border-inline-start: 4px solid var(--primary); }
.planner-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.planner-actions form { margin: 0; }
.planner-short { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px; }
.library-item { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.library-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.library-item img.is-tall { width: 42px; height: 74px; }
.library-item > span { display: grid; }
.library-ph { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 8px; background: var(--surface-2); font-size: 22px; }
.library-actions { gap: 4px; flex-wrap: nowrap; }
.library-actions form { margin: 0; }
.library-grid { margin-top: 0; }
.inbox-comment { padding: 14px 16px; }
.inbox-comment.is-replied { opacity: .8; }
.inbox-comment-body { margin: 8px 0; }
.inbox-comment-actions { display: flex; gap: 8px; align-items: center; }
.inbox-comment-actions form { margin: 0; }
.inline-reply { display: flex; gap: 6px; flex: 1; }
.inline-reply input { flex: 1; }
@media (max-width: 900px) {
  .biz-body, .planner-layout, .publisher-grid { grid-template-columns: 1fr; }
  .biz-nav { position: static; display: flex; overflow-x: auto; }
  .biz-nav a { white-space: nowrap; }
  .publisher-preview { position: static; }
  .video-drop { max-height: 60vh; margin: 0 auto; }
}
@media (max-width: 640px) {
  .shorts-feed { height: calc(100dvh - 170px); }
  .cal-day { min-height: 64px; }
  .cal-item b { display: none; }
  .planner-short { grid-template-columns: 1fr; }
}

/* ---------- languages: script fonts, RTL, language pickers ---------- */
/* Each language sets <html data-script="..."> (Lang::LANGUAGES); its Google font is loaded only for that language
   (Lang::FONTS). Taller scripts get more line height so stacked marks never collide with the next line. */
html[data-script="viet"], html[data-script="cyrl"], html[data-script="grek"] { --font: "Noto Sans", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html[data-script="viet"] { --lh: 1.6; --lh-head: 1.4; }
html[data-script="arab"] { --font: "Noto Sans Arabic", "Noto Sans Thai", system-ui, "Segoe UI", Tahoma, sans-serif; --lh: 1.75; --lh-head: 1.5; }
html[data-script="hebr"] { --font: "Noto Sans Hebrew", "Noto Sans Thai", system-ui, "Segoe UI", Arial, sans-serif; --lh: 1.6; --lh-head: 1.35; }
html[data-script="thaa"] { --font: "Noto Sans Thaana", "MV Boli", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.85; --lh-head: 1.55; }
html[data-script="deva"] { --font: "Noto Sans Devanagari", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.7; --lh-head: 1.45; }
html[data-script="beng"] { --font: "Noto Sans Bengali", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.7; --lh-head: 1.45; }
html[data-script="guru"] { --font: "Noto Sans Gurmukhi", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.7; --lh-head: 1.45; }
html[data-script="gujr"] { --font: "Noto Sans Gujarati", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.7; --lh-head: 1.45; }
html[data-script="orya"] { --font: "Noto Sans Oriya", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.75; --lh-head: 1.5; }
html[data-script="taml"] { --font: "Noto Sans Tamil", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.7; --lh-head: 1.45; }
html[data-script="telu"] { --font: "Noto Sans Telugu", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.75; --lh-head: 1.5; }
html[data-script="knda"] { --font: "Noto Sans Kannada", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.75; --lh-head: 1.5; }
html[data-script="mlym"] { --font: "Noto Sans Malayalam", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.75; --lh-head: 1.5; }
html[data-script="sinh"] { --font: "Noto Sans Sinhala", "Nirmala UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.75; --lh-head: 1.5; }
html[data-script="tibt"] { --font: "Noto Serif Tibetan", "Microsoft Himalaya", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.9; --lh-head: 1.6; }
html[data-script="mymr"] { --font: "Noto Sans Myanmar", "Myanmar Text", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.9; --lh-head: 1.6; }
html[data-script="khmr"] { --font: "Noto Sans Khmer", "Leelawadee UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.8; --lh-head: 1.55; }
html[data-script="laoo"] { --font: "Noto Sans Lao", "Leelawadee UI", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.75; --lh-head: 1.5; }
html[data-script="jpan"] { --font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.6; --lh-head: 1.4; }
html[data-script="kore"] { --font: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.6; --lh-head: 1.4; }
html[data-script="hans"] { --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.6; --lh-head: 1.4; }
html[data-script="hant"] { --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.6; --lh-head: 1.4; }
html[data-script="geor"] { --font: "Noto Sans Georgian", "Sylfaen", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.6; --lh-head: 1.4; }
html[data-script="armn"] { --font: "Noto Sans Armenian", "Sylfaen", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.6; --lh-head: 1.4; }
html[data-script="ethi"] { --font: "Noto Sans Ethiopic", "Ebrima", "Noto Sans Thai", system-ui, sans-serif; --lh: 1.65; --lh-head: 1.45; }
/* Cursive Arabic letters must stay joined; CJK avoids breaking before small kana and closing punctuation. */
html[data-script="arab"] body * { letter-spacing: normal !important; }
html[data-script="jpan"] body, html[data-script="hans"] body, html[data-script="hant"] body { line-break: strict; }

/* Posts, comments and messages follow the direction of their own text, whatever the interface language. */
.post-body, .comment-text, .bubble, .bio, .short-caption, .page-body, .inbox-comment-body, .announcement { unicode-bidi: plaintext; text-align: start; }
/* Right-to-left: addresses, codes and numbers stay left-to-right; directional arrows point the other way. */
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="url"], html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="password"], html[dir="rtl"] .mono, html[dir="rtl"] code { direction: ltr; text-align: end; unicode-bidi: isolate; }
html[dir="rtl"] .input-prefix { direction: ltr; }
html[dir="rtl"] .lightbox-nav { transform: translateY(-50%) scaleX(-1); }
html[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* Switching language in place: a short fade while the new text comes in. */
.topbar, .page, .auth-main, .mobile-nav { transition: opacity .18s ease; }
html.is-lang-switching .topbar, html.is-lang-switching .page, html.is-lang-switching .auth-main, html.is-lang-switching .mobile-nav { opacity: .55; }
html.is-lang-switching body { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .topbar, .page, .auth-main, .mobile-nav { transition: none; } }

.lang-picker-btn { width: auto; min-width: 44px; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; }
.lang-picker-btn .icon { width: 20px; height: 20px; }
.lang-picker-code { font-size: 11.5px; font-weight: 800; letter-spacing: .3px; }
.lang-menu { padding: 0; }
.lang-search { position: relative; display: flex; align-items: center; }
.lang-search > .icon { position: absolute; inset-inline-start: 12px; width: 17px; height: 17px; color: var(--text-2); pointer-events: none; }
.lang-search input { width: 100%; padding-inline-start: 36px; border-radius: 999px; background: var(--surface-2); border-color: transparent; }
.lang-menu .lang-search { padding: 10px; border-bottom: 1px solid var(--border); }
.lang-menu .lang-search > .icon { inset-inline-start: 22px; }
.lang-list { display: grid; gap: 2px; padding: 6px; max-height: min(60vh, 420px); overflow: auto; overscroll-behavior: contain; }
.lang-option {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "native code" "label code";
  align-items: center; column-gap: 10px; width: 100%; padding: 6px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); text-align: start; cursor: pointer; font-size: 14.5px; line-height: 1.5;
}
.lang-option:hover, .lang-option:focus-visible, .lang-option:focus-within { background: var(--surface-2); outline: none; }
.lang-option.is-active { background: var(--primary-soft); color: var(--primary); }
.lang-option input { position: absolute; opacity: 0; pointer-events: none; }
.lang-option:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--primary); }
.lang-native { grid-area: native; font-weight: 600; overflow-wrap: anywhere; line-height: 1.7; text-align: match-parent; }
.lang-native:is(:lang(my), :lang(dz), :lang(si), :lang(km), :lang(dv)) { line-height: 2; }
.lang-label { grid-area: label; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.lang-code { grid-area: code; font: 600 11px/1 ui-monospace, Consolas, monospace; color: var(--text-2); background: var(--surface-2); padding: 3px 6px; border-radius: 6px; direction: ltr; }
.lang-option.is-active .lang-code { background: var(--primary); color: var(--on-primary); }
.lang-empty { padding: 10px 14px; margin: 0; }
.lang-field { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.lang-field legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0; margin-bottom: 8px; font-weight: 600; }
.lang-field .lang-list { max-height: 300px; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.auth-top .lang-picker .dropdown-menu { inset-inline-end: 0; }
@media (max-width: 640px) {
  .lang-picker-code { display: none; }
  .lang-picker-btn { min-width: 40px; padding: 0; justify-content: center; }
}
/* ================= 3.6: sharing, messenger cards, maps, reposition, safety, copyright, marketplace ================= */
.pill-success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.pill-warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.pill-xs { font-size: 10.5px; padding: 0 6px; vertical-align: 1px; }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.input-sm, select.input-sm { padding: 6px 10px; font-size: 13px; width: auto; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-end.wrap { flex-wrap: wrap; align-items: center; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 14px; }
.check-legal { align-items: flex-start !important; font-size: 13.5px; line-height: 1.45; }
.check-legal input { margin-top: 3px; }
.flash-info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.section-title { font-size: 17px; margin: 20px 0 10px; }
.avatar-img-sm { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.code-box { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; width: 100%; resize: vertical; }
.dropdown-up > .dropdown-menu { top: auto; bottom: calc(100% + 6px); inset-inline-end: auto; inset-inline-start: 0; }

/* share menu */
.share-dropdown { flex: 1; display: flex; }
.share-dropdown > .post-action { flex: 1; }
.share-menu { min-width: 270px; top: auto; bottom: calc(100% + 6px); }
.share-menu > button span { display: grid; text-align: start; }
.share-menu > button small { color: var(--text-2); font-weight: 400; font-size: 12px; }
.share-form textarea { min-height: 70px; }
.share-author { display: flex; align-items: center; gap: 10px; }
.share-author .privacy-select { margin-inline-start: auto; }
.share-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 8px; background: var(--surface-2); }
.share-preview .post-head { gap: 8px; }
.share-preview .post-meta { display: grid; }
.share-preview-text { margin: 0; font-size: 14px; white-space: pre-line; }
.share-preview-img { max-height: 180px; width: 100%; object-fit: cover; border-radius: 8px; }
.share-preview-video { padding: 18px; text-align: center; background: var(--surface-3); border-radius: 8px; }
.share-box { display: grid; gap: 10px; }
.dm-list, .pick-list { display: grid; gap: 4px; max-height: 300px; overflow: auto; }
.dm-row, .pick-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius-sm); }
.dm-row:hover, .pick-row:hover { background: var(--surface-2); }
.dm-who { display: grid; flex: 1; min-width: 0; }
.dm-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row .btn.is-sent { background: var(--surface-3); color: var(--text-2); }
.pick-row { cursor: pointer; font-weight: 500 !important; display: flex !important; }
.pick-row input { width: auto; }
.community-thumb.sm { width: 36px; height: 36px; font-size: 15px; flex: none; }
.embed-preview iframe { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.shared-missing { color: var(--text-2); font-style: italic; text-align: center; padding: 18px; background: var(--surface-2); }

/* embed page */
.embed-body { background: transparent; padding: 0; }
.embed-post { padding: 4px; }
.embed-card { max-width: 560px; margin: 0 auto; display: grid; gap: 10px; }
.embed-card .post-head { display: flex; gap: 10px; align-items: center; }
.embed-brand { margin-inline-start: auto; }
.embed-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }

/* 18+ */
.adult-notice { display: flex; align-items: center; gap: 12px; }
.adult-notice p { margin: 2px 0 0; }
.adult-notice .btn { margin-inline-start: auto; }
.adult-badge { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); font-weight: 800; flex: none; }
.chip-adult input:checked + span { color: var(--danger); font-weight: 700; }
.permit-status { display: grid; gap: 8px; margin-bottom: 12px; }
.permit-status .avatar { display: inline-block; vertical-align: middle; }

/* messenger cards & calls */
.bubble-card { max-width: min(340px, 85%); }
.chat-card { display: flex; gap: 10px; align-items: center; background: var(--surface); color: var(--text) !important; border: 1px solid var(--border); border-radius: 12px; padding: 8px; text-decoration: none !important; margin-bottom: 4px; }
.chat-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; margin: 0; flex: none; }
.chat-card-body { display: grid; gap: 2px; min-width: 0; font-size: 13.5px; }
.chat-card-body strong { overflow: hidden; text-overflow: ellipsis; }
.chat-card-missing { justify-content: center; color: var(--text-2); font-style: italic; }
.chat-listing-ref { padding: 0 12px 8px; }
.chat-listing-card.is-compact { padding: 6px; }
.chat-listing-card.is-compact img { width: 40px; height: 40px; }
.conversation-who { flex: 1; min-width: 0; }
.conversation-tools { display: flex; gap: 4px; }
.call-panel { position: relative; height: min(70vh, 520px); background: #000; border-bottom: 1px solid var(--border); }
.call-panel iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-body .call { min-height: 100vh; }
.pay-card { display: grid; gap: 8px; align-items: stretch; }
.pay-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pay-amount { font-size: 24px; font-weight: 800; color: var(--primary); }
.pay-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 13px; }
.pay-dl dt { color: var(--text-2); }
.pay-dl dd { margin: 0; overflow-wrap: anywhere; }
.pay-qr { display: grid; justify-items: center; gap: 4px; }
.pay-qr img, .pp-qr svg { width: 200px !important; height: 200px !important; max-width: 100%; background: #fff; border-radius: 8px; padding: 4px; }
.pay-slip, .pay-report { display: block; }
.pay-card.is-paid { border-color: color-mix(in srgb, var(--success) 50%, var(--border)); }
.qr-thumb { width: 48px; height: 48px; object-fit: contain; display: inline-block; vertical-align: middle; }

/* maps */
.location-picker { display: grid; gap: 8px; }
.location-row { display: flex; align-items: center; gap: 8px; }
.location-row input { flex: 1; }
.location-map-wrap { display: grid; gap: 6px; }
.location-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.location-tools input { flex: 1; min-width: 160px; }
.location-map { height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--border); z-index: 0; }
.location-map-lg { height: min(60vh, 420px); margin-bottom: 10px; }
.location-results { display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 200px; overflow: auto; background: var(--surface); }
.location-results button { text-align: start; padding: 8px 10px; border: 0; background: none; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); }
.location-results button:hover { background: var(--surface-2); }
a.place { color: inherit; }
a.place:hover { color: var(--primary); }

/* reposition */
.profile-cover.is-repositioning { cursor: grab; outline: 3px dashed var(--primary); outline-offset: -3px; touch-action: none; }
.profile-cover.is-repositioning:active { cursor: grabbing; }
.profile-cover.is-repositioning .cover-upload > :not(.reposition-bar) { visibility: hidden; }
.reposition-bar { position: absolute; inset-inline: 12px; bottom: 12px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, .55); color: #fff; z-index: 3; }
.reposition-bar span { margin-inline-end: auto; font-weight: 600; }
.reposition-avatar { width: 260px; height: 260px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; cursor: grab; touch-action: none; border: 3px solid var(--primary); }
.reposition-avatar.is-square { border-radius: 24px; }
.reposition-avatar img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.avatar-repos { position: absolute; bottom: -6px; inset-inline-start: 50%; transform: translateX(-50%); font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; white-space: nowrap; }
.profile-avatar { position: relative; }
.cover-upload { display: flex; gap: 6px; }
.avatar img { object-fit: cover; }

/* copyright & safety */
.muted-badge { position: absolute; top: 8px; inset-inline-start: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; pointer-events: none; }
.media-video { position: relative; }
.strike-meter { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.strike-meter span { width: 34px; height: 10px; border-radius: 999px; background: var(--surface-3); }
.strike-meter span.is-on { background: var(--warn); }
.strike-3 span.is-on, .strike-2 span.is-on { background: var(--danger); }
.strike-meter strong { margin-inline-start: 8px; }
.takedown-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 6px; margin-bottom: 8px; }
.takedown-card p { margin: 0; }
.counter-form summary { list-style: none; display: inline-flex; }
.counter-form[open] summary { margin-bottom: 8px; }
.report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.dmca-form h4 { margin: 0; }
.claim-grid { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.claim-media { display: grid; gap: 6px; align-content: start; }
.claim-media video, .claim-media img { width: 100%; border-radius: 8px; background: #000; max-height: 220px; object-fit: contain; }
.claim-info { display: grid; gap: 8px; min-width: 0; }
.claim-dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 10px; margin: 0; font-size: 13.5px; }
.claim-dl dt { color: var(--text-2); }
.claim-dl dd { margin: 0; overflow-wrap: anywhere; }
.counter-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; }
.counter-box p { margin: 6px 0 0; }
.legal-page { max-width: 820px; margin: 0 auto; line-height: 1.7; }
.legal-page h2 { font-size: 18px; margin-top: 22px; }
.dmca-contact { background: var(--primary-soft); padding: 12px; border-radius: var(--radius-sm); }

/* marketplace */
.market { display: grid; gap: 16px; max-width: 1200px; margin: 0 auto; }
.market-nav { display: flex; flex-wrap: wrap; align-items: center; }
.market-sell-btn { margin-inline-start: auto; background: var(--primary); color: var(--on-primary) !important; border-radius: 999px; padding: 6px 16px !important; }
.market-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.market-filters { display: grid; gap: 12px; position: sticky; top: 76px; }
.market-filters fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.market-filters legend, .market-filters label { font-weight: 600; font-size: 13.5px; }
.market-filters label { display: grid; gap: 4px; }
.market-filters .row-gap input { flex: 1; min-width: 0; }
.market-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { display: inline-flex !important; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px !important; cursor: pointer; font-weight: 500 !important; }
.cat-chip input { display: none; }
.cat-chip.is-active { background: var(--primary); color: var(--on-primary); }
.market-safety { margin: 0; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.market-card { display: grid; gap: 4px; color: var(--text) !important; text-decoration: none !important; }
.market-thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.market-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.market-card:hover .market-thumb img { transform: scale(1.04); }
.market-noimg { font-size: 42px; }
.market-sold { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.market-price { font-weight: 800; font-size: 16px; }
.market-title { font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.market-meta { font-size: 12px; }
.market-detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
.market-gallery { position: relative; display: grid; gap: 8px; outline: none; }
.market-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); background: #111; scrollbar-width: none; }
.market-slides::-webkit-scrollbar { display: none; }
.market-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.market-slide img { width: 100%; height: 100%; object-fit: contain; }
.slider-nav { position: absolute; top: 40%; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); color: #fff; font-size: 24px; cursor: pointer; }
.slider-nav.prev { inset-inline-start: 10px; }
.slider-nav.next { inset-inline-end: 10px; }
.slider-dots { display: flex; justify-content: center; gap: 6px; }
.slider-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--surface-3); padding: 0; cursor: pointer; }
.slider-dots button.is-active { background: var(--primary); }
.slider-thumbs { display: flex; gap: 6px; overflow-x: auto; }
.slider-thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; flex: none; background: none; }
.slider-thumbs button.is-active { border-color: var(--primary); }
.slider-thumbs img { width: 64px; height: 64px; object-fit: cover; }
.market-info { display: grid; gap: 10px; align-content: start; }
.market-h1 { font-size: 22px; margin: 0; }
.market-price-lg { font-size: 28px; font-weight: 800; color: var(--primary); }
.market-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.market-desc { white-space: normal; }
.market-seller { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.market-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.market-form { max-width: 760px; width: 100%; margin: 0 auto; }
.upload-drop { display: flex !important; align-items: center; gap: 10px; padding: 18px; border: 2px dashed var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.upload-drop input { flex: 1; }
.market-edit-images { display: flex; gap: 8px; flex-wrap: wrap; }
.market-edit-img { position: relative; }
.market-edit-img img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }
.market-edit-img .icon-btn { position: absolute; top: 2px; inset-inline-end: 2px; background: rgba(0, 0, 0, .55); color: #fff; width: 26px; height: 26px; }
.radio-row { border: 0; padding: 0; margin: 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.radio-row legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.selling-list { display: grid; gap: 8px; }
.selling-row { display: flex; align-items: center; gap: 10px; }
.selling-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.selling-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selling-main { flex: 1; min-width: 0; }
.report-row { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-sm); color: var(--text) !important; text-decoration: none !important; }
.report-row:hover { background: var(--surface-2); }
.notice-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.notice-box ol { margin: 6px 0 0; padding-inline-start: 20px; }
.countdown-box { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 14%, var(--surface)); margin-bottom: 12px; }
.countdown-box strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.side-by-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.side-by-side .side { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 8px; align-content: start; }
.side-by-side h4 { margin: 0; }
.side-by-side p { margin: 0; white-space: normal; }
.evidence-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.evidence-grid img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.evidence-file { display: inline-flex; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.dispute-card { display: grid; gap: 6px; }
.blacklist-hero { text-align: center; }
.blacklist-search { display: flex; gap: 8px; align-items: center; max-width: 620px; margin: 10px auto; padding: 6px 6px 6px 14px; border: 2px solid var(--border); border-radius: 999px; background: var(--surface); }
.blacklist-search input { border: 0 !important; box-shadow: none !important; flex: 1; background: transparent; }
.blacklist-list { display: grid; gap: 10px; }
.blacklist-card { display: flex; gap: 14px; align-items: flex-start; border-inline-start: 4px solid var(--danger); }
.blacklist-main { flex: 1; display: grid; gap: 4px; min-width: 0; }
.blacklist-reason { margin: 4px 0; }
@media (max-width: 860px) {
  .market-layout, .market-detail, .claim-grid, .side-by-side { grid-template-columns: 1fr; }
  .market-filters { position: static; }
  .report-reasons { grid-template-columns: 1fr; }
  .claim-dl { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .share-menu { position: fixed; inset-inline: 8px; bottom: 70px; top: auto; min-width: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .adult-notice { flex-wrap: wrap; }
}

/* ================= phase 2: CAPTCHA widget ================= */
.captcha-altcha { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.captcha-box { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 5px; display: inline-grid; place-items: center; font-size: 13px; line-height: 1; }
.captcha-altcha[data-state="working"] .captcha-box { border-color: var(--primary); border-top-color: transparent; border-radius: 50%; animation: captcha-spin .8s linear infinite; }
.captcha-altcha[data-state="done"] .captcha-box { border-color: var(--success); background: var(--success); color: #fff; }
.captcha-altcha[data-state="done"] .captcha-box::after { content: "✓"; }
.captcha-altcha[data-state="error"] .captcha-box { border-color: var(--danger); }
.captcha-altcha[data-state="error"] .captcha-status { color: var(--danger); }
.captcha-note { grid-column: 1 / -1; }
.captcha-modal { display: grid; gap: 12px; justify-items: center; padding: 8px; }
@keyframes captcha-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .captcha-altcha[data-state="working"] .captcha-box { animation: none; } }
/* Group chats */
.avatar-img-md { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.bubble-sender { display: block; font-weight: 600; font-size: 12px; opacity: .8; margin-bottom: 2px; }
.chat-system { text-align: center; font-size: 12px; color: var(--text-2); margin: 6px auto; max-width: 80%; }
.group-panel { margin: 8px; padding: 12px; max-height: 50vh; overflow: auto; }
.group-members { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.group-members li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-members li > span { flex: 1; min-width: 120px; }
.group-pick { border: 0; padding: 0; max-height: 45vh; overflow: auto; display: grid; gap: 6px; }
.group-pick .check { display: flex; align-items: center; gap: 8px; }

/* Voice messages */
.voice-rec.is-rec { color: #fff; background: #dc2626; border-radius: 50%; animation: voice-pulse 1.2s infinite; }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .25); } }
@media (prefers-reduced-motion: reduce) { .voice-rec.is-rec { animation: none; } }
.voice-timer { font-variant-numeric: tabular-nums; font-size: 13px; color: #dc2626; align-self: center; }
.voice-msg { display: flex; align-items: center; gap: 6px; }
.voice-msg audio { max-width: 240px; height: 36px; }

/* End-to-end encrypted chats */
.e2e-toggle.is-on { color: #16a34a; }
.e2e-note { font-size: 12px; padding: 6px 12px; background: var(--surface-2, rgba(22, 163, 74, .08)); border-bottom: 1px solid var(--border); }
.e2e-note code { letter-spacing: .05em; }
.e2e-msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.e2e-hidden { display: none !important; }

/* Quote posts: the quoted post is a smaller card under the comment */
.shared-post.is-quote { font-size: .94em; border-radius: 14px; }
.shared-post.is-quote .post-body { -webkit-line-clamp: 8; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

/* Post edit history */
.edit-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-height: 60vh; overflow: auto; }
.edit-history li { border-left: 3px solid var(--border); padding-left: 10px; }
.edit-history li:first-child { border-color: var(--primary); }
.edit-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Lists */
.list-card { display: grid; gap: 2px; text-decoration: none; color: inherit; }
.list-card:hover { border-color: var(--primary); }
.list-members { list-style: none; padding: 0; display: grid; gap: 6px; }
.list-members li { display: flex; align-items: center; gap: 8px; }
.list-members li form { margin-left: auto; }
.list-pick { display: grid; gap: 6px; margin-bottom: 10px; }

/* Trends */
.trend-list { list-style: none; padding: 0; }
.trend-list li a { display: flex; align-items: center; gap: 12px; padding: 10px 4px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border); }
.trend-list li:last-child a { border-bottom: 0; }
.trend-list li a:hover, .trend-list li a:focus-visible { background: var(--surface-2); }
.trend-rank { width: 2ch; text-align: center; color: var(--muted, #888); font-weight: 600; }
.trend-body { display: grid; gap: 2px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.trend-growth { margin-inline-start: auto; color: var(--success, #1a8f4c); font-weight: 600; white-space: nowrap; }

/* Alt text & accessibility */
.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
main.page:focus { outline: none; }
:where(a, button, summary, [tabindex], label[role=button]):focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.market-gallery:focus-visible { outline: 3px solid var(--primary); }
.preview-item { display: grid; gap: 4px; align-content: start; width: 140px; }
.composer-previews .preview-item img, .composer-previews .preview-item video { width: 100%; height: 96px; }
.alt-input { font-size: 12.5px; padding: 6px 8px; }
.comment-alt { margin-top: 6px; }
.market-edit-img .alt-input { margin-top: 4px; }
.alt-badge { position: absolute; inset-inline-start: 6px; bottom: 6px; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.72); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; pointer-events: auto; }
.lightbox-alt { max-width: 760px; margin: 8px auto 0; color: #fff; background: rgba(0,0,0,.6); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; white-space: pre-wrap; }

/* Translate button on posts */
.post-translate { padding: 0 16px 8px; }
.post-translation { margin-top: 6px; padding-inline-start: 10px; border-inline-start: 3px solid var(--border); display: grid; gap: 4px; }
.post-translation .post-body { padding: 0; }

/* Passkeys */
.passkey-list { list-style: none; padding: 0; display: grid; gap: 8px; margin: 0 0 10px; }
.passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.passkey-list li > span { display: grid; gap: 2px; }
#passkeys .toolbar { padding: 0; flex-wrap: wrap; }
#passkeys .toolbar input { flex: 1; min-width: 180px; width: auto; }
.passkey-2fa { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Phone verification */
.phone-verify { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.phone-verify [data-phone-code] { width: 8.5em; }


/* Appeals */
.badge-status.is-bad { background: color-mix(in srgb, var(--danger, #d33) 18%, transparent); color: var(--danger, #d33); }
.appeal-action { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px; display: grid; gap: 6px; }
.appeal-action p { margin: 0; }
.appeal-form summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.appeal-post { margin: 6px 0; padding: 8px 12px; border-inline-start: 3px solid var(--border); background: var(--surface-2); }
.input-sm { width: auto; min-width: 200px; padding: 5px 8px; font-size: 13px; }

/* Community Notes */
.community-note { margin: 8px 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 4px; }
.community-note p { margin: 0; }
.community-note-head { font-size: 13.5px; }
.note-card { display: grid; gap: 6px; }
.note-card p { margin: 0; }
.note-rate { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.note-queue-item { margin-bottom: 14px; }

/* Image hash review */
.hash-preview summary { cursor: pointer; color: var(--primary); font-size: 13.5px; }
.hash-preview img { display: block; max-width: min(320px, 100%); max-height: 320px; margin-top: 6px; border-radius: var(--radius-sm); }

/* Fediverse */
.fedi-actor { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.fedi-actor-name { display: grid; flex: 1; min-width: 0; }
.fedi-actor-name small { overflow-wrap: anywhere; }
.fedi-avatar { display: inline-grid; place-items: center; background: var(--surface-2); }
.fedi-handle { overflow-wrap: anywhere; }
.fedi-facts { margin: 8px 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.fedi-post { display: grid; gap: 8px; }
.fedi-content { overflow-wrap: anywhere; }
.fedi-content p { margin: 0 0 8px; }
.fedi-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.fedi-media img, .fedi-media video { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius-sm); }
.fedi-media img.is-blurred { filter: blur(18px); }
.fedi-media img.is-blurred:hover, .fedi-media img.is-blurred:focus { filter: none; }
.fedi-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fedi-cw summary { cursor: pointer; font-weight: 600; }

/* Feed ranking */
.feed-tabs:has(.feed-tabs-settings) { grid-template-columns: 1fr 1fr auto; }
.feed-tabs a.feed-tabs-settings { display: inline-flex; align-items: center; padding: 12px 14px; }
.feed-tab-hint { margin: 4px 2px 10px; }
.ranking-weight { display: grid; gap: 4px; margin-bottom: 12px; }
.ranking-weight span { display: grid; }
.ranking-weight output { font-weight: 700; color: var(--primary); }
.ranking-weight input[type=range] { width: 100%; }
.ranking-formula { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); overflow-x: auto; }
.ranking-reasons { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.ranking-table th { text-align: start; width: 40%; font-weight: 600; }

/* Privacy page */
.privacy-page { max-width: 820px; margin: 0 auto; display: grid; gap: 14px; }
.privacy-page p { line-height: 1.65; }
.privacy-toc { columns: 2 220px; margin: 8px 0 0; padding-inline-start: 22px; }
.privacy-list { padding-inline-start: 22px; display: grid; gap: 6px; }
.privacy-table td:first-child { width: 55%; }
.privacy-foot { text-align: center; }
