:root {
  --bg: #eef3fb;
  --card: #ffffff;
  --text: #1b2333;
  --muted: #5d6980;
  --border: #dde2ec;
  --accent: #3a6df0;
  --accent-text: #ffffff;
  --danger: #c4373b;
  --ok: #1d8a4d;
  --warn: #a35c00;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151d;
    --card: #1a202b;
    --text: #e7ebf3;
    --muted: #9aa5b9;
    --border: #2b3342;
    --accent: #6b93ff;
    --accent-text: #0b0f17;
    --danger: #ff7b7f;
    --ok: #5bd18f;
    --warn: #f5b04a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); }

header.top {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; height: 58px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
header.top .brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; text-decoration: none; color: var(--text);
}
header.top .brand svg { width: 30px; height: 21px; color: var(--accent); }
header.top nav { display: flex; gap: 6px; align-items: center; font-size: .95rem; }
.main-nav > a { white-space: nowrap; }
.main-nav > a:not(.button) {
  color: var(--text); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.main-nav > a:not(.button):hover { background: var(--bg); }
.main-nav > a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center;
}
.write-btn { margin-left: 4px; }
.me-menu { position: relative; margin-left: 4px; }
.me-menu summary { list-style: none; cursor: pointer; display: flex; border-radius: 50%; }
.me-menu summary::-webkit-details-marker { display: none; }
.me-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.me-menu .menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; z-index: 10;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .18); display: flex; flex-direction: column;
}
.me-menu .menu > a, .me-menu .menu > button {
  padding: 9px 12px; border-radius: 9px; color: var(--text); text-decoration: none; text-align: left; font-weight: 500;
}
.me-menu .menu > a:hover, .me-menu .menu > button:hover { background: var(--bg); }
.menu-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.nav-icon { display: none; }
.nav-icon svg { display: block; }
@media (max-width: 640px) {
  .nav-icon { display: inline-flex; }
  .nav-label { display: none; }
  header.top { padding: 0 10px; }
  header.top .brand span { display: none; }
  .main-nav > a:not(.button) { padding: 7px 8px; }
  .write-btn { padding: 5px 12px; font-size: 1.1rem; }
  .write-label { display: none; }
}
/* Small phones: "My page" is also the first item in the avatar menu. */
@media (max-width: 480px) {
  .main-nav > a.nav-mypage { display: none; }
  header.top nav { gap: 2px; }
  .bell-menu summary { padding: 7px 6px; }
}
/* Narrow phones: tighten the header so the whole row fits. */
@media (max-width: 420px) {
  header.top { padding: 0 6px; gap: 2px; }
  header.top nav { gap: 0; font-size: .9rem; }
  .main-nav > a:not(.button), .main-nav > a.nav-search, .bell-menu summary { padding: 7px 5px; }
  .write-btn { padding: 5px 9px; }
}

main { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
main.wide-main { max-width: 1040px; }
main.narrow { max-width: 420px; padding-top: 10vh; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
}
.card h1, .card h2 { margin-top: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); font-size: .92rem; }
.center { text-align: center; }

label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=number], input[type=search] {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--danger); }
button.small { padding: 5px 12px; font-size: .85rem; }
button.link { border: none; background: none; padding: 0; color: var(--accent); font-weight: 400; }
button:disabled { opacity: .55; cursor: default; }
.wide { width: 100%; }

.stack > * + * { margin-top: 12px; }
.google-slot { display: flex; justify-content: center; min-height: 44px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

.message { min-height: 1.5em; font-size: .92rem; margin-top: 12px; }
.message.error { color: var(--danger); }
.message.ok { color: var(--ok); }

.list { list-style: none; padding: 0; margin: 0; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--border);
}
.list li:first-child { border-top: none; }
.list .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.pill.pending { color: var(--accent); border-color: var(--accent); }

.invite-result { word-break: break-all; background: var(--bg); padding: 12px; border-radius: 10px; margin-top: 12px; font-family: ui-monospace, monospace; font-size: .85rem; }
[hidden] { display: none !important; }
.spaced { margin-top: 24px; }

.small { font-size: .85rem; }
a.button { text-decoration: none; }
a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.small { padding: 5px 12px; font-size: .85rem; }
textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit;
}
textarea { resize: vertical; line-height: 1.55; }
select { width: auto; }
.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* ---- Avatars ---- */
.avatar { display: inline-block; border-radius: 50%; object-fit: cover; flex: none; background: var(--border); }
.avatar.s32 { width: 32px; height: 32px; font-size: .9rem; }
.avatar.s36 { width: 36px; height: 36px; font-size: 1rem; }
.avatar.s40 { width: 40px; height: 40px; font-size: 1.05rem; }
.avatar.s48 { width: 48px; height: 48px; font-size: 1.2rem; }
.avatar.s56 { width: 56px; height: 56px; font-size: 1.4rem; }
.avatar.s96 { width: 96px; height: 96px; font-size: 2.2rem; }
.avatar.s160 { width: 160px; height: 160px; font-size: 4rem; }
.avatar.initial { display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-family: system-ui, sans-serif; line-height: 1; }
.hue0 { background: linear-gradient(135deg, #5b8cff, #3a5bd9); }
.hue1 { background: linear-gradient(135deg, #ff7eb3, #e2457f); }
.hue2 { background: linear-gradient(135deg, #34d399, #0f9f6e); }
.hue3 { background: linear-gradient(135deg, #fbbf24, #e8870b); }
.hue4 { background: linear-gradient(135deg, #a78bfa, #7347e8); }
.hue5 { background: linear-gradient(135deg, #22d3ee, #0b8fb3); }
.hue6 { background: linear-gradient(135deg, #fb7185, #d63a4b); }
.hue7 { background: linear-gradient(135deg, #94a3b8, #56657c); }

/* ---- People lists ---- */
.people-list { list-style: none; padding: 0; margin: 0 0 10px; }
.people-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.person > span { display: flex; flex-direction: column; min-width: 0; }
.person > span > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.big strong { font-size: 1.1rem; }
.people-list .actions { display: flex; gap: 6px; }

/* ---- Home ---- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.home-side { position: sticky; top: 78px; }
@media (max-width: 860px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-side { position: static; order: -1; }
  .home-side .card:not(.me-card):not(#requests-card):not(.bulletin-card) { display: none; }
}
.feed-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.greeting { margin: 0; font-size: 1.8rem; letter-spacing: -.02em; }
.tabs { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.tabs button { border: none; background: none; padding: 6px 14px; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-text); }
.feed .card { padding: 18px 20px; margin-bottom: 14px; }
.post-by { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.post-by .who { font-weight: 700; color: var(--text); text-decoration: none; }
.post-by .small { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
a.quiet { color: inherit; text-decoration: none; }
.mood { font-style: italic; }
.pill.lock { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.post-title { margin: 0 0 6px; font-size: 1.25rem; line-height: 1.25; }
.post-title a { color: var(--text); text-decoration: none; }
.excerpt { margin: 0 0 10px; color: color-mix(in srgb, var(--text) 85%, var(--muted)); overflow-wrap: anywhere; }
/* Feed pictures show whole (no cropping), up to a comfortable height; tap for full size. */
.thumb-pic { display: flex; justify-content: center; margin-bottom: 10px; border-radius: 10px; overflow: hidden; background: color-mix(in srgb, var(--text) 6%, var(--card)); }
.thumb-pic img { display: block; max-width: 100%; height: auto; max-height: min(70vh, 640px); object-fit: contain; }
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- Full-size picture viewer (public/js/lightbox.js) ---- */
.lightbox {
  border: none; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: rgb(0 0 0 / .9); color: #fff; display: none; flex-direction: column;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgb(0 0 0 / .6); }
html.lightbox-open { overflow: hidden; }
.lightbox-figure { flex: 1; min-height: 0; margin: 0; padding: 52px 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.lightbox-figure img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 6px; }
.lightbox-figure figcaption { font-size: .95rem; opacity: .85; text-align: center; }
.lightbox-close {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; padding: 0;
  border: none; background: rgb(255 255 255 / .15); color: #fff; font-size: 1.2rem; cursor: pointer;
}
.lightbox-close:hover, .lightbox-close:focus-visible { background: rgb(255 255 255 / .3); }
.lightbox-bar { display: flex; justify-content: center; gap: 20px; padding: 10px 12px 16px; font-size: .95rem; }
.lightbox-bar a { color: #fff; }
.post-foot { display: flex; justify-content: space-between; font-size: .9rem; }
.post-foot a { text-decoration: none; }
.empty { text-align: center; padding: 36px 20px; }

/* ---- Dialog ---- */
.site-dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--card); color: var(--text); width: min(440px, calc(100vw - 32px)); max-height: 80vh; padding: 16px 20px; }
.site-dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; }
.dialog-head button { border: none; padding: 4px 10px; }

/* ---- Writer ---- */
.writer h1 { margin-bottom: 12px; }
.title-input { font-size: 1.4rem !important; font-weight: 700; border: none !important; background: transparent !important; padding: 6px 0 !important; }
.title-input:focus { outline: none; border-bottom: 2px solid var(--accent) !important; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.toolbar > button, .tool-upload { padding: 5px 12px; font-size: .9rem; min-width: 38px; }
.tool-upload { font-weight: 600; }
.toolbar .spacer { flex: 1; }
.small-tabs button { padding: 4px 12px; font-size: .85rem; }
.preview-box { min-height: 300px; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; }
.preview-box.mp-rich { --mp-radius: 12px; --mp-accent: var(--accent); --mp-soft: var(--bg); }
.visibility { border: none; padding: 0; margin: 14px 0 0; }
.visibility legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.visibility .check { margin: 6px 0; font-size: .98rem; }

/* ---- Top 8 editor ---- */
.top8 { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .top8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); min-width: 0;
}
.empty-slot { border-style: dashed; justify-content: center; min-height: 128px; }
.slot-num { position: absolute; top: 6px; left: 8px; font-size: .75rem; font-weight: 800; color: var(--muted); }
.slot-name { font-size: .85rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-tools { display: flex; gap: 4px; }
.slot-tools button { padding: 2px 8px; }

/* ---- Customize ---- */
main.custom-main { max-width: 1320px; }
.custom-grid { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 24px; align-items: start; }
.custom-controls h1 { margin-top: 0; }
.custom-controls .card { padding: 20px; }
.custom-controls h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.custom-preview { position: sticky; top: 78px; }
.preview-frame-wrap { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: 0 10px 30px rgb(0 0 0 / .1); }
.preview-label { padding: 8px 14px; font-weight: 600; font-size: .9rem; border-bottom: 1px solid var(--border); }
#preview { display: block; width: 100%; height: calc(100vh - 150px); border: 0; background: #fff; }
@media (max-width: 960px) {
  .custom-grid { grid-template-columns: minmax(0, 1fr); }
  .custom-preview { position: static; order: -1; }
  #preview { height: 60vh; }
}
.custom-controls select { max-width: 100%; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.two .check { margin-bottom: 10px; }
.avatar-row, .bg-row { display: flex; gap: 16px; align-items: center; }
.avatar-row .stack, .bg-row .stack { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.bg-thumb { width: 120px; height: 80px; border-radius: 10px; border: 1px dashed var(--border); display: grid; place-items: center; overflow: hidden; flex: none; }
.bg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bg-slots { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-start; margin: 6px 0 4px; }
.bg-slot { display: grid; gap: 6px; justify-items: start; }
.bg-slot-label { font-weight: 600; font-size: .92rem; }
.bg-thumb-wide { width: 160px; height: 100px; }
.bg-thumb-tall { width: 70px; height: 124px; }
.bg-slot-actions { display: flex; gap: 8px; align-items: center; }
.bg-help { margin: 12px 0 0; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
.theme-group { grid-column: 1 / -1; margin: 8px 0 -2px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.theme-group:first-child { margin-top: 0; }
.theme-card { flex-direction: column; padding: 7px 7px 6px; border-radius: 14px; gap: 6px; font-weight: 600; min-width: 0; }
.theme-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.theme-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Mini previews: a real member page at 960x640, scaled down to 120x80. */
.tp-view {
  position: relative; display: block; width: 120px; height: 80px; overflow: hidden; flex: none;
  border-radius: 8px; border: 1px solid rgb(0 0 0 / .1); pointer-events: none; contain: strict;
}
.mp-mini {
  container: mpw / inline-size; width: 960px; height: 640px; padding-top: 0;
  transform: scale(.125); transform-origin: 0 0; text-align: left; font-weight: 400; line-height: 1.5;
}
.mp-mini .mp-panel-title { font-weight: 700; }
.mp-mini .mp-post-title { font-weight: 700; }
.mp-mini .mini-avatar { background: color-mix(in srgb, var(--mp-accent) 45%, var(--mp-panel)); }
.mp-mini .mp-avatar .mini-avatar { width: 160px; height: 160px; margin: 0 auto; border-radius: calc(var(--mp-radius) * 1.2); }
.mp-mini .mp-friend .mini-avatar { width: 100%; aspect-ratio: 1; border-radius: calc(var(--mp-radius) * .6); }
.theme-name { font-size: .88rem; }

.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.color-row { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; }
.color-row input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; flex: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }
textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.5; tab-size: 2; }
.css-help { margin-top: 10px; }
.css-help summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.css-help ul { padding-left: 18px; }
.css-help li { margin: 4px 0; }
.css-help [data-snippet] { margin: 4px 4px 0 0; }

.uploads { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.upload { margin: 0; }
.upload-img { padding: 0; border-radius: 10px; overflow: hidden; width: 100%; aspect-ratio: 1; }
.upload-img img { width: 100%; height: 100%; object-fit: cover; }
.upload figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; display: flex; flex-direction: column; gap: 1px; }
.upload-where { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.3; }
.upload.unused .upload-where { color: var(--ok); font-weight: 600; }
.upload.unused .upload-img { outline: 2px dashed color-mix(in srgb, var(--ok) 60%, transparent); outline-offset: 2px; }
.uploads-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.uploads-head p { margin: 0 0 10px; flex: 1 1 240px; }
.uploads-head label { display: inline-flex; gap: 6px; align-items: center; margin: 0 0 10px; }
.uploads-head select { width: auto; padding: 4px 8px; }
.usage-meter { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 22%, transparent); overflow: hidden; margin: -4px 0 12px; }
.usage-meter > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s; }
.usage-meter.low > span { background: var(--warn); }
.usage-meter.full > span { background: var(--danger); }
.space-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: .9rem;
  background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.message.warn, .warn-text { color: var(--warn); }
.manage-uploads { white-space: nowrap; font-weight: 600; }

.save-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 16px; margin: 0 -4px; border: 1px solid var(--border); border-radius: 16px 16px 0 0;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px);
}
.save-bar .message { margin: 0 auto 0 0; }

/* ---- YouTube players (posts, the feed, profile songs) ----
   Just a thumbnail and a play button until someone taps; the real player
   comes from youtube-nocookie.com, so it costs this server nothing. */
.yt {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  background: #000; border-radius: 10px; overflow: hidden; margin: 16px 0;
}
.yt-play { all: unset; position: absolute; inset: 0; cursor: pointer; display: block; }
.yt-play img, .thumb.yt img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-height: none;
  object-fit: cover; margin: 0; border-radius: 0; transition: filter .2s;
}
.yt-icon {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%);
  background: #f00; border-radius: 14px; box-shadow: 0 4px 18px rgb(0 0 0 / .35); transition: transform .15s;
}
.yt-icon::after {
  content: ''; position: absolute; left: 27px; top: 14px;
  border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff;
}
.yt-play:hover img { filter: brightness(.85); }
.yt-play:hover .yt-icon, .yt-play:focus-visible .yt-icon { transform: translate(-50%, -50%) scale(1.08); }
.yt-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.thumb.yt { margin: 0 0 10px; }

/* ---- Notifications bell ---- */
.bell-menu { position: relative; }
.bell-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 10px; border-radius: 999px; color: var(--text);
}
.bell-menu summary::-webkit-details-marker { display: none; }
.bell-menu summary:hover, .bell-menu[open] summary { background: var(--bg); }
.bell-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bell-icon svg { display: block; }
.notif-menu {
  position: fixed; right: 12px; top: 64px; z-index: 110; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .18);
}
.notif-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.notif {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: .92rem; line-height: 1.35;
}
.notif:hover { background: var(--bg); }
.notif.unread { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.notif-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.notif-snippet { color: var(--muted); font-style: italic; }
.notif-empty { padding: 12px 10px; margin: 0; font-size: .92rem; }
.notif-more { display: block; margin: 4px auto; }

/* ---- Reactions (home feed) ---- */
.reactions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; position: relative; }
.reaction, .react-add {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .88rem; line-height: 1.3;
  border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer;
}
.reaction-mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.reaction-count { font-weight: 700; font-size: .8rem; }
.react-add { color: var(--muted); }
.react-wrap { position: relative; display: inline-flex; }
.react-picker, .mp-react-picker {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 20; display: flex; gap: 2px; padding: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
.react-picker[hidden], .mp-react-picker[hidden] { display: none; }
.react-picker button, .mp-react-picker button {
  border: none; background: none; font-size: 1.25rem; padding: 4px 6px; border-radius: 999px; cursor: pointer; line-height: 1;
}
.react-picker button:hover, .react-picker button:focus-visible,
.mp-react-picker button:hover, .mp-react-picker button:focus-visible { background: var(--bg); transform: scale(1.15); }
.react-who { border: none; background: none; padding: 0; color: var(--muted); font-size: .82rem; cursor: pointer; }
.react-who:hover { text-decoration: underline; }
.react-list { list-style: none; margin: 4px 0 0; padding: 0; flex-basis: 100%; font-size: .85rem; color: var(--muted); }
.post-foot { align-items: center; gap: 10px; flex-wrap: wrap; }
.comment-link { white-space: nowrap; margin-left: auto; }

/* ---- @mentions ---- */
a.mention { font-weight: 600; text-decoration: none; }
a.mention:hover { text-decoration: underline; }
.mention-list {
  list-style: none; margin: 4px 0 0; padding: 4px; max-width: 360px; position: relative; z-index: 30;
  background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / .16);
  font-family: system-ui, sans-serif; font-size: .92rem; text-align: left;
}
.mention-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.mention-list li.active, .mention-list li:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.mention-list .muted { font-size: .85rem; }

/* ---- Quick status + live feed ---- */
.status-box { padding: 14px 16px; }
.status-row { display: flex; gap: 12px; align-items: flex-start; }
.status-row textarea { flex: 1; resize: vertical; min-height: 44px; font-size: 1.02rem; }
.status-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-left: 52px; flex-wrap: wrap; }
.status-actions select { width: auto; padding: 5px 10px; font-size: .88rem; }
.status-count { margin-left: auto; }
.status-full { text-decoration: none; }
.status-count:empty + .status-full { margin-left: auto; }
.status-box .message:empty { display: none; }
.status-box .mention-list { margin-left: 52px; }
.new-posts {
  position: sticky; top: 70px; z-index: 20; display: block; margin: 0 auto 12px;
  background: var(--accent); color: var(--accent-text); border: none; border-radius: 999px; padding: 7px 16px; font-weight: 700;
  box-shadow: 0 6px 18px rgb(0 0 0 / .18);
}
.new-posts[hidden] { display: none; }
.status-text { font-size: 1.15rem; line-height: 1.5; margin: 0 0 10px; overflow-wrap: anywhere; }
.status-text p { margin: 0 0 .5em; }
.status-text > :last-child { margin-bottom: 0; }
.draft-status { margin: 6px 0 0; }
.draft-status:empty { display: none; }
@media (max-width: 520px) {
  .status-actions { padding-left: 0; }
  .status-box .mention-list { margin-left: 0; }
  .status-row > span { display: none; }
}

/* ---- TikTok players ----
   A small card until someone taps; then TikTok's official single-video
   player (no account or app needed) loads at its tall 9:16 shape. */
.tt {
  position: relative; width: min(100%, 320px); height: 200px; margin: 16px 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #111 0%, #1d1d2b 60%, #2a1630 100%); color: #fff;
}
.tt.playing { height: auto; aspect-ratio: 9 / 16; background: #000; }
.tt-play {
  all: unset; position: absolute; inset: 0; cursor: pointer; box-sizing: border-box; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  font-family: system-ui, sans-serif;
}
.tt-icon { color: #fff; filter: drop-shadow(2px 2px 0 #25f4ee) drop-shadow(-2px -2px 0 #fe2c55); transition: transform .15s; }
.tt-icon svg { display: block; }
.tt-label { font-weight: 800; font-size: 1.05rem; }
.tt-hint { font-size: .85rem; opacity: .8; }
.tt-play:hover .tt-icon, .tt-play:focus-visible .tt-icon { transform: scale(1.1); }
.tt-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.tt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.thumb.tt { margin: 0 0 10px; }

/* ---- Instagram and Facebook players ----
   Same idea as TikTok: a small card until someone taps, then the site's own
   public player (no account or app needed). Instagram's grows to the height
   its page asks for; Facebook reels are 9:16, Facebook videos 16:9. */
.ig, .fb {
  position: relative; width: min(100%, 360px); height: 200px; margin: 16px 0; border-radius: 12px; overflow: hidden; color: #fff;
}
.ig { background: linear-gradient(135deg, #4f5bd5 0%, #962fbf 35%, #d62976 65%, #fa7e1e 100%); }
.fb { background: linear-gradient(135deg, #0a3a8c 0%, #1877f2 100%); }
.fb.fb-reel { width: min(100%, 320px); }
.fb.fb-video { width: 100%; }
.ig.playing { height: auto; background: #fff; }
.fb.playing { background: #000; }
.fb.fb-reel.playing { height: auto; aspect-ratio: 9 / 16; }
.fb.fb-video.playing { height: auto; aspect-ratio: 16 / 9; }
.ig-play, .fb-play {
  all: unset; position: absolute; inset: 0; cursor: pointer; box-sizing: border-box; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  font-family: system-ui, sans-serif;
}
.ig-icon svg, .fb-icon svg { display: block; transition: transform .15s; }
.ig-label, .fb-label { font-weight: 800; font-size: 1.05rem; }
.ig-hint, .fb-hint { font-size: .85rem; opacity: .85; }
.ig-play:hover svg, .ig-play:focus-visible svg, .fb-play:hover svg, .fb-play:focus-visible svg { transform: scale(1.1); }
.ig-play:focus-visible, .fb-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.ig iframe { display: block; width: 100%; height: 640px; border: 0; } /* until Instagram says how tall */
.fb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.thumb.ig, .thumb.fb { margin: 0 0 10px; }

/* Theme codes on /customize */
.code-redeem { margin: 4px 0 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; }
.code-redeem label { margin-top: 0; }
.code-redeem .message { margin-top: 6px; min-height: 0; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .06em; }
.code-row input::placeholder { text-transform: none; letter-spacing: 0; }
.code-list { list-style: none; padding: 0; margin: 8px 0 0; }
.code-list li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); }
.code-chip { font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.code-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Polls (home feed) ---- */
.poll, .mp-poll { margin: 4px 0 12px; }
.poll-options, .mp-poll-options { display: flex; flex-direction: column; gap: 6px; }
.poll-option {
  display: block; width: 100%; text-align: left; padding: 9px 14px; border-radius: 10px; font-weight: 600;
  border: 1.5px solid var(--accent); background: var(--card); color: var(--accent); cursor: pointer;
}
.poll-option:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.poll-option:disabled { cursor: default; opacity: .7; }
.poll-option:has(.poll-result) { padding: 0; border: none; background: none; }
.poll-result, .mp-poll-result {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-radius: 10px; overflow: hidden; background: var(--bg); color: var(--text);
}
.poll-bar, .mp-poll-bar {
  position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%);
  background: color-mix(in srgb, var(--accent) 22%, transparent); transition: width .5s ease-out;
}
.poll-label, .poll-pct, .mp-poll-label, .mp-poll-pct { position: relative; }
.poll-label { font-weight: 600; overflow-wrap: anywhere; }
.poll-pct { font-weight: 700; font-size: .9rem; color: var(--muted); }
.poll-mine .poll-bar { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.poll-winner .poll-label::after, .mp-poll-winner .mp-poll-label::after { content: ' 🏆'; }
.poll-check, .mp-poll-check { color: var(--accent); font-weight: 800; }
.poll-meta { margin-top: 6px; font-size: .82rem; color: var(--muted); }

/* ---- Poll builder (status box + /write) ---- */
.poll-builder { border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px 8px; margin: 10px 0 0; min-width: 0; }
.poll-builder legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.poll-builder-option { display: flex; gap: 6px; margin-bottom: 6px; }
.poll-builder-option input { flex: 1; min-width: 0; }
.poll-remove { border: none; background: none; font-size: 1.2rem; line-height: 1; padding: 0 8px; color: var(--muted); }
.poll-builder-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.poll-closes { width: auto; padding: 5px 10px; font-size: .88rem; }
.status-poll[aria-pressed="true"], .tool-poll[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.status-box .poll-builder { margin-left: 52px; }
@media (max-width: 520px) { .status-box .poll-builder { margin-left: 0; } }

/* ---- Bulletins ---- */
.bulletin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.bulletin-head h2 { margin: 0; }
.bulletin-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.bulletin-list li + li { border-top: 1px dashed var(--border); }
.bulletin-link { display: flex; gap: 10px; align-items: center; padding: 8px 2px; color: var(--text); text-decoration: none; }
.bulletin-link:hover .bulletin-title { text-decoration: underline; }
.bulletin-text { display: flex; flex-direction: column; min-width: 0; }
.bulletin-title { overflow-wrap: anywhere; }
.bulletin-list li.unseen .bulletin-title { font-weight: 700; }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; vertical-align: middle; }
.bulletin-empty { padding: 6px 0; }
.bulletin-form label { display: block; font-weight: 600; margin: 10px 0 4px; }
.bulletin-form textarea, .bulletin-form input { width: 100%; }
.bulletin-kicker { margin-top: 14px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.bulletin-subject { margin: 4px 0 14px; font-size: 1.7rem; line-height: 1.2; overflow-wrap: anywhere; }
.bulletin-body { margin: 16px 0 20px; --mp-radius: 12px; --mp-accent: var(--accent); --mp-soft: var(--bg); }
.bulletin-more { display: none; margin-top: 6px; }
@media (max-width: 860px) {
  .bulletin-list:not(.expanded) li:nth-child(n+4) { display: none; }
  .bulletin-more { display: inline; }
}
#status-post { margin-left: auto; }

/* ---- Moderation (admin page, admin bar on member pages) ---------------------------- */
button.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.pill.suspended { color: var(--danger); border-color: var(--danger); }
/* Members: search, filter chips, a collapsible invite tree and one detail panel. */
.tree-tools { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.tree-tools input[type=search] { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .85rem; font-weight: 500; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tree-stats { margin: 4px 0 6px; }
.pill.new { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.bad { color: var(--danger); }
.itree, .member-results { list-style: none; margin: 0; padding: 0; }
.itree .itree { margin-left: 13px; padding-left: 8px; border-left: 2px solid var(--border); }
.itree-line { display: flex; align-items: flex-start; gap: 2px; border-radius: 10px; transition: background .3s; }
.itree-line.flash { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.itree-toggle { flex: 0 0 26px; height: 32px; padding: 0; border: none; background: none; color: var(--muted); font-size: .9rem; cursor: pointer; }
.itree-toggle.leaf { display: inline-block; }
.person-row { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; font: inherit; font-weight: 400; color: var(--text); background: none; border: 1px solid transparent; border-radius: 10px; padding: 5px 8px; cursor: pointer; }
.person-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.person-row.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.person-row .person-name { overflow-wrap: anywhere; }
.person-row .pill { margin-left: 6px; }
.person-row.is-suspended .person-name strong { text-decoration: line-through; opacity: .7; }
.member-results li { margin: 2px 0; }
.member-detail { margin: 10px 0 14px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.member-detail h3 { margin: 0 0 2px; font-size: 1.05rem; overflow-wrap: anywhere; }
.member-detail h3 .pill { margin-left: 6px; font-weight: 400; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.detail-close { flex: none; width: 34px; height: 34px; padding: 0; border-radius: 999px; }
.detail-row { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0; font-size: .92rem; }
.detail-label { flex: 0 0 92px; color: var(--muted); }
.chain { overflow-wrap: anywhere; }
.chain .sep { color: var(--muted); }
.kid-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.kid-chip { font: inherit; font-size: .82rem; font-weight: 400; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; }
.kid-chip.is-suspended { color: var(--danger); border-color: var(--danger); text-decoration: line-through; }
.member-detail .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.list .actions { align-items: center; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: 5px 4px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: " ▾"; }
details.more[open] { flex-basis: 100%; }
details.more[open] .actions { margin-top: 6px; }
.report-quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--border); background: var(--bg); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.purge-dialog { width: min(560px, calc(100vw - 24px)); max-height: 90vh; overflow-y: auto; }
.purge-dialog .check { margin: 10px 0; }
.purge-dialog h3 { font-size: 1rem; margin: 16px 0 6px; }
.purge-preview { margin-top: 8px; }
.purge-people, .purge-counts { margin: 0; padding-left: 20px; }
.purge-people li, .purge-counts li { margin: 3px 0; }
.purge-people li.depth-1 { margin-left: 14px; }
.purge-people li.depth-2 { margin-left: 28px; }
.purge-people li.depth-3, .purge-people li.depth-4 { margin-left: 42px; }
.purge-people .pill { margin-left: 6px; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: 1100px; margin: 8px auto 0; padding: 8px 16px; font-size: .9rem; }
@media (max-width: 640px) {
  /* Big enough to hit fast with a thumb. */
  .list .actions button.small, .admin-bar button.small { min-height: 40px; padding: 8px 14px; }
  .itree .itree { margin-left: 8px; padding-left: 4px; }
  .detail-label { flex-basis: 100%; }
  .member-detail .actions button.small { min-height: 40px; padding: 8px 14px; }
  .purge-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .purge-dialog input[type=text] { font-size: 16px; } /* stops iOS zooming in */
}

/* ---- Search ---- */
.main-nav > a.nav-search { padding: 7px 9px; }
.main-nav > a.nav-search svg { display: block; }
@media (max-width: 480px) { .main-nav > a.nav-search { padding: 7px 6px; } }
.search-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-form input { flex: 1; min-width: 0; margin: 0; }
.search-heading { font-size: 1rem; margin: 18px 0 10px; color: var(--muted); }
.search-result .excerpt a { color: inherit; text-decoration: none; }
mark { background: color-mix(in srgb, var(--warn) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---- Saving posts, hashtags ---- */
.save-btn { margin-left: auto; background: none; border: 0; padding: 4px 6px; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; border-radius: 8px; }
.save-btn:hover { color: var(--text); background: var(--bg); }
.save-btn.saved { color: var(--accent); }
.post-card.unsaved { opacity: .55; }
a.hashtag { text-decoration: none; }
a.hashtag:hover { text-decoration: underline; }

/* ---- Friends online ---- */
.online-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.online-person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; color: inherit; text-decoration: none; text-align: center; }
.online-person .small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-avatar { position: relative; display: inline-flex; }
.online-dot { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--card); }

/* ---- Photos on a member's page ---- */
.photos-dialog { width: min(760px, calc(100vw - 32px)); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.photo-grid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; cursor: zoom-in; background: var(--bg); }
.photo-grid p { grid-column: 1 / -1; }

/* ---- Account: notification choices, your data ---- */
.card h3 { font-size: 1rem; margin: 18px 0 4px; }
.check-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.quiet-hours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.quiet-hours input[type=time] { width: auto; }
.danger-zone { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.danger-zone summary { cursor: pointer; color: var(--danger); }
.danger-zone form { display: grid; gap: 8px; max-width: 360px; }

/* ---- Events on posts ---- */
.event, .mp-event { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 4px 0 12px; display: grid; gap: 6px; }
.event-when, .mp-event-when { font-weight: 700; }
.event-past, .mp-event-past { font-weight: 400; color: var(--muted); }
.event-answers, .mp-event-answers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.event-answer, .mp-event-answer { font-size: .88rem; padding: 4px 10px; border-radius: 999px; }
.event-mine, .mp-event-mine { background: var(--accent); border-color: var(--accent); color: #fff; }
.event-who, .mp-event-who { font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }
.event-builder .two { margin-top: 6px; }

/* ---- A shared post, inside the post that shares it ---- */
.repost, .mp-repost { display: grid; gap: 4px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; padding: 8px 12px; margin: 4px 0 12px; color: inherit; text-decoration: none; }
a.repost:hover { background: var(--bg); }
.repost-by, .mp-repost-by { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.repost-title, .mp-repost-title { font-weight: 700; }
.repost-text, .mp-repost-text { color: var(--muted); font-size: .93rem; overflow-wrap: anywhere; }
.repost-hidden, .mp-repost-hidden { color: var(--muted); font-size: .9rem; font-style: italic; }

/* ---- Share ---- */
.share-menu { position: relative; display: inline-block; margin-left: auto; }
.share-menu + .save-btn { margin-left: 0; }
.share-menu > summary { list-style: none; cursor: pointer; }
.share-menu > summary::-webkit-details-marker { display: none; }
.share-btn { color: var(--muted); font-size: .9rem; padding: 4px 6px; border-radius: 8px; }
.share-btn:hover { color: var(--text); background: var(--bg); }
.share-options { position: absolute; right: 0; bottom: 100%; z-index: 5; min-width: 170px; display: grid; gap: 2px; padding: 6px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 24px rgb(0 0 0 / .15); }
.share-options button { text-align: left; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.share-options button:hover { background: var(--bg); }

/* ---- Inviting people ---- */
.invite-form { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-form input { flex: 1 1 220px; }
.invite-fresh { display: flex; gap: 6px; margin-top: 6px; }
.invite-fresh .invite-link { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: .85rem; }
.invite-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Admin: at a glance ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; margin: 0 0 14px; }
.stats dt { font-size: .8rem; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; }
.setting-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.setting-row input[type=number] { width: 5rem; }
.setting-row label { margin: 0; }

/* ---- Word Duel ---- */
.main-nav > a.nav-games { position: relative; }
.main-nav > a.nav-games .badge { position: absolute; top: -2px; right: -4px; }
.new-game { display: grid; gap: 8px; max-width: 460px; }
.new-game select { margin-left: 26px; width: auto; max-width: calc(100% - 26px); }
.game-list li { padding: 4px 0; }
.word-form { display: flex; gap: 8px; margin: 8px 0; }
.word-input, #new-word, .guess-word { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; text-transform: lowercase; }
.word-input { max-width: 14rem; font-size: 1.15rem; }
.guess-list { list-style: none; padding: 0; margin: 10px 0; }
.guess-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.guess-n { width: 1.4rem; text-align: right; color: var(--muted); font-size: .85rem; }
.guess-letters { display: inline-flex; gap: 5px; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--border); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; text-transform: lowercase; }
.mark-place { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.mark-elsewhere { border-style: dashed; border-color: var(--accent); color: var(--accent); }
.mark-none { color: var(--muted); opacity: .5; text-decoration: line-through; }
.mark-untried { border-color: transparent; }
.mark-key .mark { width: 1.5rem; height: 1.5rem; font-size: .8rem; margin-left: 8px; vertical-align: middle; }
.mark-key .mark:first-child { margin-left: 0; }
.game-result { font-size: 1.1rem; font-weight: 700; }
.letter-pad { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 12px; max-width: 460px; }
.letter-pad .mark { width: 1.8rem; height: 1.8rem; font-size: .9rem; }
.game-board { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 4px; }
.game-board li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.their-guesses summary { cursor: pointer; color: var(--muted); font-size: .88rem; }

.session-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.session-row .pill { margin-left: 6px; }

/* ---- A notice from the admins, the welcome card, memories ---- */
.site-notice { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; background: color-mix(in srgb, var(--accent) 14%, var(--card)); border-bottom: 1px solid var(--border); font-size: .95rem; }
.site-notice span { overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.welcome-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.welcome-head h2 { margin: 0; }
.welcome-steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.welcome-steps li { display: flex; gap: 8px; align-items: baseline; }
.welcome-steps li.done { color: var(--muted); text-decoration: line-through; }
.welcome-tick { width: 1.2em; flex: none; color: var(--accent); font-weight: 800; text-decoration: none; }
.memory-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.memory { display: grid; color: inherit; text-decoration: none; }
.memory:hover strong { text-decoration: underline; }
.notice-form { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; display: grid; gap: 8px; }
.notice-row { border-top: 0; padding-top: 0; }
.notice-row input[type=text] { flex: 1 1 140px; }
.notice-row select { width: auto; }
