/* Socially Awkward — no inline styles anywhere (CSP style-src 'self') */
:root {
  --bg: #fbfaf7; --bg2: #f2efe9; --card: #ffffff; --ink: #18171c; --muted: #6d6a73; --line: #e6e2da;
  --accent: #ff5a3c; --accent2: #ff8a3d; --accent-ink: #fff; --ok: #1f8a4c; --err: #c62f2f;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(20,16,10,.06);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f0f12; --bg2: #18181d; --card: #16161b; --ink: #f1efe9; --muted: #9a97a3; --line: #2a2a31;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f12; --bg2: #18181d; --card: #16161b; --ink: #f1efe9; --muted: #9a97a3; --line: #2a2a31;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.inline { display: inline; margin: 0; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-in { max-width: 975px; margin: 0 auto; height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 800; font-size: 15px; transform: rotate(-6deg); }
.brand-name { font-family: var(--serif); font-size: 21px; font-style: italic; }
.topnav { display: flex; align-items: center; gap: 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer; min-height: 42px; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { padding: 7px 12px; font-size: 13px; min-height: 34px; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-ink); border-color: transparent; }
.btn-accent:hover { border-color: transparent; filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg2); border-color: transparent; }
.btn-danger { color: var(--err); }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 16px; }
.icon-btn:hover { background: var(--bg2); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: inline; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-toggle .i-moon { display: none; }
  :root[data-theme="auto"] .theme-toggle .i-sun { display: inline; }
}

/* layout */
.wrap { width: 100%; max-width: 975px; margin: 0 auto; padding: 0 0 40px; flex: 1; }
.wrap-admin { max-width: 760px; padding: 20px 16px 48px; }
.foot { max-width: 975px; width: 100%; margin: 0 auto; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; gap: 16px; justify-content: center; color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }

/* profile header */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 28px 16px 24px; }
.avatar { display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--accent), var(--accent2)); flex: none; text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 88px; height: 88px; padding: 3px; }
.avatar-lg img, .avatar-lg .avatar-initial { border-radius: 50%; border: 3px solid var(--bg); }
.avatar-sm { width: 40px; height: 40px; }
.avatar-initial { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; font: 700 32px/1 var(--serif); font-style: italic; }
.avatar-sm .avatar-initial { font-size: 18px; }
.profile-name { margin: 0; font: italic 700 26px/1.15 var(--serif); letter-spacing: -.01em; }
.profile-handle { color: var(--muted); font-size: 14px; }
.profile-stats { margin-top: 6px; font-size: 15px; }
.profile-bio { margin: 8px 0 0; white-space: normal; max-width: 52ch; }
@media (min-width: 736px) {
  .profile { gap: 64px; padding: 40px 48px 36px; }
  .avatar-lg { width: 150px; height: 150px; padding: 4px; }
  .avatar-lg .avatar-initial { font-size: 60px; }
  .profile-name { font-size: 32px; }
}

/* grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-top: 1px solid var(--line); padding-top: 3px; }
@media (min-width: 736px) { .grid { gap: 6px; padding-top: 6px; } }
.tile { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--bg2); text-decoration: none; }
.tile picture, .tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile img, .tile video { transition: transform .35s ease, filter .35s ease; }
.tile:hover img, .tile:hover video { transform: scale(1.03); filter: brightness(.92); }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.thought { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10%; background: linear-gradient(150deg, var(--card), var(--bg2)); border: 1px solid var(--line); }
.thought::before { content: "\201C"; position: absolute; top: 2%; left: 7%; font: 700 64px/1 var(--serif); color: var(--accent); opacity: .5; }
.thought p { margin: 0; font: italic 600 clamp(11px, 2.2vw, 19px)/1.35 var(--serif); text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.badge { width: 20px; height: 20px; fill: #fff; stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.55)); }
.tile-text .badge { fill: var(--accent); stroke: var(--accent); filter: none; }
.badge rect, .badge path[d^="M3"] { fill: none; }
.pager { display: flex; justify-content: center; gap: 10px; padding: 28px 16px; }
.pager.loading a { opacity: .5; pointer-events: none; }

/* empty state */
.empty { text-align: center; padding: 56px 24px 72px; border-top: 1px solid var(--line); color: var(--muted); }
.empty h2 { color: var(--ink); margin: 14px 0 6px; font: italic 700 26px/1.2 var(--serif); }
.empty p { max-width: 36ch; margin: 0 auto 20px; }
.empty-face { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 26px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font: 800 34px/1 var(--font); transform: rotate(-8deg); box-shadow: var(--shadow); }

/* post page */
.post { display: grid; grid-template-columns: 1fr; background: var(--card); margin: 0 auto; max-width: 935px; }
@media (min-width: 900px) {
  .post { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  .post-text { grid-template-columns: 1fr; max-width: 640px; }
}
.notice { grid-column: 1 / -1; padding: 10px 16px; background: color-mix(in srgb, var(--accent) 14%, var(--card)); font-size: 14px; }
.carousel { position: relative; background: #000; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; display: grid; place-items: center; max-height: 85vh; min-height: 240px; }
.slide picture, .slide img, .slide video { width: 100%; max-height: 85vh; object-fit: contain; }
.car-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #111; font-size: 24px; line-height: 1; cursor: pointer; display: none; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.car-btn:disabled { opacity: 0; pointer-events: none; }
.car-prev { left: 10px; } .car-next { right: 10px; }
@media (hover: hover) { .car-btn { display: block; } }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 5px; justify-content: center; pointer-events: none; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); transition: background .2s, transform .2s; }
.dot.on { background: #fff; transform: scale(1.25); }
.post-side { display: flex; flex-direction: column; padding: 14px 16px 20px; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.post-name { font-weight: 700; text-decoration: none; }
.post-loc { font-size: 13px; color: var(--muted); }
.post-head .pill { margin-left: auto; }
.caption { padding: 14px 0; white-space: normal; overflow-wrap: anywhere; }
.caption-big { font: italic 600 clamp(20px, 4.5vw, 28px)/1.4 var(--serif); padding: 28px 0; }
.post-text .post-side { padding: 24px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: auto; padding-top: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.post-meta a { color: var(--accent); }
.back { margin-top: 18px; font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--bg2); font-size: 12px; font-weight: 600; color: var(--muted); }
.pill-published { color: var(--ok); }
.pill-scheduled { color: var(--accent); }

/* admin */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.login-card { max-width: 380px; margin: 40px auto; text-align: center; }
.login-card h1 { font: italic 700 26px/1.2 var(--serif); margin: 16px 0; }
.stack { display: grid; gap: 14px; text-align: left; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.admin-head h1 { margin: 0; font: italic 700 28px/1.2 var(--serif); }
.ok, .err { padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.ok { background: color-mix(in srgb, var(--ok) 14%, var(--card)); }
.err { background: color-mix(in srgb, var(--err) 14%, var(--card)); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; text-decoration: none; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.admin-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.admin-thumb { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--bg2); display: grid; place-items: center; text-decoration: none; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { color: var(--muted); font: italic 700 18px var(--serif); }
.admin-cap { font-weight: 600; overflow-wrap: anywhere; }
.admin-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 3px; }
.admin-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 640px) { .admin-row { grid-template-columns: 64px 1fr auto; } .admin-actions { grid-column: auto; } }

.composer { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
input, textarea, select { font: 16px/1.4 var(--font); color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
small { font-weight: 400; color: var(--muted); font-size: 12px; }
.row2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1.4fr 1fr; } }
.dropzone { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--card); cursor: pointer; font-weight: 400; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-size: 30px; font-weight: 300; }
.media-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.media-list:empty { display: none; }
.mitem { display: grid; grid-template-columns: 22px 72px 1fr auto; gap: 10px; align-items: center; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.mitem.dragging { opacity: .6; border-color: var(--accent); }
.handle { cursor: grab; touch-action: none; color: var(--muted); text-align: center; user-select: none; font-size: 18px; letter-spacing: -3px; }
.mprev { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--bg2); }
.mfields { display: grid; gap: 6px; min-width: 0; }
.mfields input { padding: 8px 10px; font-size: 14px; }
.mname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mremove { display: flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 400; font-size: 13px; color: var(--muted); }
.mbtns { display: grid; gap: 2px; }
.mbtns .icon-btn { width: 32px; height: 32px; }
fieldset.status { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
fieldset.status legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.seg { display: inline-flex; font-weight: 600; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.when { opacity: .7; }
.when.need { opacity: 1; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.more label { margin-top: 10px; }
.actions { display: flex; gap: 10px; }
.actions .btn-accent { min-width: 120px; }
.progress { height: 6px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.progress .bar { height: 100%; width: 3%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .2s; }
.bar[data-pct="10"]{width:10%}.bar[data-pct="20"]{width:20%}.bar[data-pct="30"]{width:30%}.bar[data-pct="40"]{width:40%}.bar[data-pct="50"]{width:50%}.bar[data-pct="60"]{width:60%}.bar[data-pct="70"]{width:70%}.bar[data-pct="80"]{width:80%}.bar[data-pct="90"]{width:90%}.bar[data-pct="100"]{width:100%}
.danger-zone { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.avatar-edit { display: flex; align-items: center; gap: 18px; }
@media (max-width: 480px) { .brand-name { font-size: 18px; } .topnav .btn-ghost { padding: 7px 8px; } }

/* ===== 1.1.0: sign-in icon, account menu, profile links, /admin/login states, links manager ===== */
.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; }
.icon-btn:focus-visible, .btn:focus-visible, .plink:focus-visible, .acct summary:focus-visible, .acct-menu a:focus-visible, .acct-menu button:focus-visible, .handle:focus-visible, .gbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn svg { flex: none; }

/* top-right sign-in icon (signed out): quiet utility, muted */
.signin-btn { color: var(--muted); }
.signin-btn:hover, .signin-btn:focus-visible { color: var(--ink); }
@media (pointer: coarse) { .topnav .icon-btn, .acct summary { width: 44px; height: 44px; } }

/* account menu (signed in): native <details>, works without JS */
.acct { position: relative; }
.acct summary { list-style: none; cursor: pointer; border-radius: 50%; display: grid; place-items: center; width: 38px; height: 38px; }
.acct summary::-webkit-details-marker { display: none; }
.acct summary::marker { content: ""; }
.acct[open] summary, .acct summary:hover { background: var(--bg2); }
.acct-av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--accent), var(--accent2)); padding: 2px; }
.acct-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); }
.acct-initial { color: #fff; font: italic 700 15px/1 var(--serif); }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(20,16,10,.16); padding: 6px; z-index: 40; }
.acct-who { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-who strong { display: block; font: italic 700 17px/1.2 var(--serif); }
.acct-who span { color: var(--muted); font-size: 12.5px; }
.acct-menu form { margin: 0; }
.acct-menu a, .acct-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); font: 500 14.5px/1 var(--font); text-decoration: none; cursor: pointer; text-align: left; }
.acct-menu a:hover, .acct-menu button:hover, .acct-menu a:focus-visible, .acct-menu button:focus-visible { background: var(--bg2); }
.acct-menu a:focus-visible, .acct-menu button:focus-visible { outline-offset: -2px; }
.acct-menu svg { color: var(--muted); flex: none; }
.acct-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.acct-menu .danger, .acct-menu .danger svg { color: var(--err); }
@media (pointer: coarse) { .acct-menu a, .acct-menu button { min-height: 44px; } }

/* profile links: one list; desktop under the bio, mobile a full-width row under the header */
.profile.has-links { grid-template-areas: "av text" "links links"; }
.profile.has-links > .avatar { grid-area: av; }
.profile.has-links > .profile-text { grid-area: text; }
.profile.has-links > .profile-links { grid-area: links; }
@media (min-width: 736px) {
  .profile.has-links { grid-template-areas: "av text" "av links"; row-gap: 14px; }
  .profile.has-links > .profile-text { align-self: end; }
  .profile.has-links > .profile-links { align-self: start; }
}
.profile-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.profile-links li { display: flex; }
.plink { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--b, #6d6a73); color: #fff; text-decoration: none; transition: transform .15s, filter .15s, box-shadow .15s; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.plink:hover, .plink:focus-visible { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.plink img { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }
.plink::after { content: attr(data-label); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 5px 9px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 600 12px/1 var(--font); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.plink:hover::after, .plink:focus-visible::after { opacity: 1; }
@media (max-width: 735px) { .profile-links { gap: 10px; } .plink { width: 44px; height: 44px; } .plink::after { display: none; } }
@media (pointer: coarse) { .plink { width: 44px; height: 44px; } }

/* brand fills (Decision 11). Colors live here, never in style="" (CSP style-src 'self'). */
.b-blog { --b: linear-gradient(135deg, #ff5a3c, #ff8a3d); }
.b-instagram { --b: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); background-color: #FF0069; }
.b-threads { --b: #000000; }
.b-x { --b: #000000; }
.b-facebook { --b: #0866FF; }
.b-linkedin { --b: #0A66C2; }
.b-youtube { --b: #FF0000; }
.b-tiktok { --b: #000000; }
.b-github { --b: #181717; }
.b-mastodon { --b: #6364FF; }
.b-bluesky { --b: #1185FE; }
.b-email { --b: #5b6470; }
.b-website { --b: #2f7d6d; }
.b-link { --b: #6d6a73; }
:root[data-theme="dark"] :is(.b-threads, .b-x, .b-tiktok, .b-github) { box-shadow: 0 0 0 1px #3a3a42; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] :is(.b-threads, .b-x, .b-tiktok, .b-github) { box-shadow: 0 0 0 1px #3a3a42; } }

/* minimal /admin/login (errors + fallback only) */
.gate .empty-face { margin-top: 4px; }
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid #dadce0; background: #fff; color: #1f1f1f; font: 500 15px/1 Roboto, Arial, var(--font); text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.gbtn:hover { background: #f8faff; border-color: #c6d2f0; }
.gbtn.is-disabled { opacity: .5; cursor: not-allowed; }
.gate-sub { color: var(--muted); margin: -6px 0 18px; font-size: 14.5px; }
.gate-err { margin: 0 0 14px; text-align: left; }
.gate-fine { color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.gate-fine a { color: var(--muted); }

/* admin: profile tabs + links manager (mockup 05) */
.tabs { display: flex; gap: 6px; margin: 0 0 18px; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 26px 0 10px; }
.section-h h2 { margin: 0; font: italic 700 21px/1.2 var(--serif); }
.section-h span { color: var(--muted); font-size: 13px; }
.links-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lrow { display: grid; grid-template-columns: 28px 40px 1fr; gap: 12px; align-items: center; padding: 10px 10px 10px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
@media (min-width: 640px) { .lrow { grid-template-columns: 28px 40px 1fr auto; } }
.lrow.is-hidden > :not(.lbtns) { opacity: .55; }
.lrow.is-editing { border-color: var(--accent); }
.lrow.dragging, .lrow.is-grabbed { box-shadow: 0 10px 30px rgba(20,16,10,.18); border-color: var(--accent); }
.lrow .handle { border: 0; background: transparent; padding: 8px 0; border-radius: 8px; }
.lico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--b); color: #fff; }
.lico img { width: 20px; height: 20px; border-radius: 4px; }
.ltext { min-width: 0; }
.ltext strong { display: block; font-size: 15px; }
.ltext .lurl { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbtns { grid-column: 1 / -1; display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
@media (min-width: 640px) { .lbtns { grid-column: auto; } }
.lbtns .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.lbtns .icon-btn:hover { color: var(--ink); }
.lbtns .icon-btn:disabled { opacity: .35; cursor: default; }
.lbtns .icon-btn.del:hover { color: var(--err); }
@media (pointer: coarse) { .lbtns .icon-btn { width: 44px; height: 44px; } }
.lempty { color: var(--muted); }
.form-card { margin-top: 14px; display: grid; gap: 16px; }
.detect { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ok); font-weight: 600; margin-top: -4px; }
.hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.ipick-set { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.ipick-set legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.ipick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.ipick-opt { position: relative; display: grid; justify-items: center; gap: 5px; padding: 10px 4px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font: 500 11.5px/1.1 var(--font); color: var(--muted); cursor: pointer; text-align: center; }
.ipick-opt .pico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--b); color: #fff; }
.ipick-opt.up .pico { background: transparent; color: var(--ink); border: 1px dashed var(--line); }
.ipick-opt.up { border-style: dashed; }
.ipick-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--card)); color: var(--ink); box-shadow: 0 0 0 1px var(--accent) inset; }
.ipick-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.custom-file { font-weight: 500; }
.checks { display: flex; gap: 22px; flex-wrap: wrap; }
.preview-strip { display: flex; align-items: center; gap: 10px; padding: 12px 14px 34px; border: 1px dashed var(--line); border-radius: 12px; background: var(--bg); flex-wrap: wrap; }

/* ===== 1.3.0: nerdynate.com landing page (centred hero, A/B hybrid feed grid) ===== */
.landing-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 16px 8px; }
.landing-hero .avatar-lg { width: 104px; height: 104px; }
@media (min-width: 736px) { .landing-hero .avatar-lg { width: 132px; height: 132px; } }
.landing-name { margin-top: 14px; }
.landing-bio { margin-left: auto; margin-right: auto; }
.landing-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 0; padding: 0; }
.landing-links li { display: flex; }
.llink { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 600 14px/1 var(--font); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.llink:hover, .llink:focus-visible { transform: translateY(-1px); border-color: var(--muted); box-shadow: var(--shadow); }
.llink .lic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--b, #6d6a73); color: #fff; flex: none; }
.llink .lic img { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; }
.landing-h { max-width: 1100px; margin: 26px auto 0; padding: 0 16px; font: italic 700 22px/1.2 var(--serif); }
.landing-feed { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 1100px; margin: 14px auto 0; padding: 0 16px; }
@media (min-width: 820px) { .landing-feed { grid-template-columns: 1fr 1fr; } }
.lcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.lcard-photo { position: relative; background: var(--bg2); }
.lcard-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.lcard-count { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font: 600 12px/1.4 var(--font); }
.thought-static { position: relative; padding: 30px 24px 10px; background: linear-gradient(150deg, var(--card), var(--bg2)); }
.thought-static::before { content: "\201C"; position: absolute; top: 0; left: 14px; font: 700 56px/1 var(--serif); color: var(--accent); opacity: .5; }
.thought-static p { margin: 0; font: italic 600 clamp(17px, 2.4vw, 21px)/1.45 var(--serif); overflow-wrap: anywhere; }
.lcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lcard-cap { margin: 0; overflow-wrap: anywhere; }
.lcard-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.lcard-blog { font-weight: 700; color: var(--accent); text-decoration: none; margin-top: auto; }
.lcard-blog:hover { text-decoration: underline; }
.lcard-also { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lcard-also span { color: var(--muted); font-size: 13px; }
.lcard-also a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font: 600 13px/1.4 var(--font); text-decoration: none; }
.lcard-also a:hover { border-color: var(--muted); }

/* ═══ 2.0.0 — timeline, link cards, comments, admin stats ═══ */
.tl-search { display:flex; gap:.5rem; justify-content:center; margin:.9rem auto 0; max-width:420px; }
.tl-search input { flex:1; padding:.5rem .8rem; border:1px solid var(--line); border-radius:999px; background:var(--card); color:var(--ink); }
.tl-nav { margin-top:.6rem; font-size:.9rem; }
.tl-list { max-width:640px; margin:1.2rem auto 2rem; display:flex; flex-direction:column; gap:1rem; padding:0 .75rem; }
.tl-list-head { max-width:640px; margin:1.5rem auto 0; padding:0 .75rem; }
.tl-list-head h1 { margin:.2rem 0; font-size:1.6rem; }
.tl-card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:1rem 1.1rem; box-shadow:var(--shadow); }
.tl-head { display:flex; align-items:center; gap:.6rem; }
.tl-head .avatar-sm { width:40px; height:40px; }
.tl-who { display:flex; flex-direction:column; line-height:1.25; }
.tl-handle { color:var(--muted); font-size:.85rem; }
.tl-time { margin-left:auto; color:var(--muted); font-size:.85rem; text-decoration:none; white-space:nowrap; }
.tl-time:hover { text-decoration:underline; }
.tl-pinned { color:var(--accent); font-size:.8rem; font-weight:600; margin-top:.5rem; }
.tl-thread-note { color:var(--muted); font-size:.85rem; margin-top:.5rem; }
.tl-text { margin-top:.55rem; font-size:1.02rem; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.tl-text a, .comment-body a { color:var(--accent); }
.tag-link { color:var(--accent); font-weight:600; text-decoration:none; }
.tag-link:hover { text-decoration:underline; }
.tl-media { margin-top:.7rem; border-radius:14px; overflow:hidden; }
.tl-media img, .tl-media video { width:100%; height:100%; object-fit:cover; display:block; }
.tl-media-1 img, .tl-media-1 video { max-height:520px; object-fit:cover; }
.tl-media-2, .tl-media-3, .tl-media-4 { display:grid; gap:4px; }
.tl-media-2 { grid-template-columns:1fr 1fr; }
.tl-media-3 { grid-template-columns:1fr 1fr; }
.tl-media-3 .tl-cell:first-child { grid-row:span 2; }
.tl-media-4 { grid-template-columns:1fr 1fr; }
.tl-cell { position:relative; display:block; aspect-ratio:4/3; }
.tl-media-3 .tl-cell:first-child { aspect-ratio:auto; }
.tl-more { position:absolute; right:.5rem; bottom:.5rem; background:rgba(0,0,0,.65); color:#fff; padding:.15rem .5rem; border-radius:999px; font-size:.85rem; }
.tl-meta { display:flex; flex-wrap:wrap; gap:.4rem 1rem; margin-top:.7rem; color:var(--muted); font-size:.85rem; }
.tl-meta a { color:var(--muted); }
.linkcard { display:flex; gap:.8rem; margin-top:.7rem; border:1px solid var(--line); border-radius:14px; padding:.7rem .8rem; text-decoration:none; color:var(--ink); background:var(--bg); }
.linkcard:hover { border-color:var(--accent); }
.linkcard-img img { width:84px; height:84px; object-fit:cover; border-radius:10px; display:block; }
.linkcard-body { display:flex; flex-direction:column; gap:.2rem; min-width:0; }
.linkcard-title { font-weight:700; line-height:1.3; }
.linkcard-desc { color:var(--muted); font-size:.9rem; line-height:1.4; }
.linkcard-host { color:var(--muted); font-size:.8rem; }
.post-nav { display:flex; justify-content:space-between; gap:1rem; margin-top:1rem; }
.tl-thread, .comments { max-width:640px; margin:1.5rem auto; padding:0 .75rem; }
.tl-thread-list { margin:.5rem 0 0; padding-left:1.2rem; display:flex; flex-direction:column; gap:.35rem; }
.tl-thread-list li.on a { font-weight:700; }
.tl-thread-list time { color:var(--muted); font-size:.85rem; margin-left:.5rem; }
.comment { border-top:1px solid var(--line); padding:.8rem 0; }
.comment header time { color:var(--muted); font-size:.85rem; margin-left:.5rem; }
.comment-body { margin-top:.3rem; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.comment-form { display:flex; flex-direction:column; gap:.6rem; margin-top:1.2rem; }
.comment-form label { display:flex; flex-direction:column; gap:.3rem; font-weight:600; font-size:.92rem; }
.comment-form input, .comment-form textarea { padding:.55rem .7rem; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--ink); font:inherit; }
.comment-note { color:var(--muted); font-size:.88rem; }
.comment-disabled { opacity:.75; }
.hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
.archive-list { max-width:640px; margin:1rem auto 2rem; padding:0 .75rem; list-style:none; display:flex; flex-direction:column; gap:.5rem; }
.archive-list li { display:flex; justify-content:space-between; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:.7rem 1rem; }
.archive-list span { color:var(--muted); }
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:.8rem; margin:1rem 0 1.5rem; }
.stat { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:.9rem 1rem; display:flex; flex-direction:column; gap:.2rem; }
.stat strong { font-size:1.5rem; }
.stat span { color:var(--muted); font-size:.85rem; }
.comment-row { align-items:flex-start; }
.pill-approved { background:var(--accent); color:#fff; }
.pill-rejected, .pill-spam { background:var(--line); }
.privacy { max-width:640px; margin:1.5rem auto 2rem; padding:0 .75rem; line-height:1.6; }
.privacy h1 { margin:.2rem 0 .4rem; font-size:1.6rem; }
.privacy h2 { margin:1.5rem 0 .4rem; font-size:1.15rem; }
.privacy p { margin:.5rem 0; overflow-wrap:anywhere; }
.privacy .updated { color:var(--muted); font-size:.9rem; }

/* ═══ 2.0.5 — timeline hero: avatar left, text column right ═══
   Scoped via the .tl-hero modifier (timeline home only): .landing-hero is
   shared with landing.php, whose hero keeps the centred column — no rule
   here touches it without the modifier. The row is capped at the timeline's
   640px column so the avatar's left edge lines up with the cards below. */
.tl-hero { flex-direction: row; align-items: flex-start; text-align: left; gap: 1rem; max-width: 640px; margin-left: auto; margin-right: auto; padding: 36px .75rem 8px; }
.tl-hero-main { flex: 1 1 auto; min-width: 0; }
.tl-hero .landing-name { margin-top: 0; }
.tl-hero .landing-bio { margin-left: 0; margin-right: 0; }
.tl-hero .landing-links { justify-content: flex-start; }
.tl-hero .tl-search { justify-content: flex-start; margin-left: 0; margin-right: 0; }
.tl-hero .tl-search input { min-width: 0; }
@media (max-width: 480px) {
  .tl-hero { gap: .75rem; }
  .tl-hero .avatar-lg { width: 88px; height: 88px; }
}

/* ═══ 2.0.6 — profile links + Archive move into the top bar ═══
   layout.php renders the pills (.top-links/.tlink) and an Archive icon
   button inside .topnav on every public page (admin chrome unchanged).
   The nav is flex:none and the brand absorbs the squeeze (min-width: 0,
   name ellipsised), so the bar never wraps and the controls never drop
   off — at 320px the brand name truncates instead. At ≤640px the pills
   collapse to icon-only circles (the anchor's aria-label/title carry the
   name) and the signed-in "New" button steps aside — "New post" remains
   in the account menu beside it, and admin pages keep their own chrome.
   (.tl-nav and the .tl-hero .landing-links override above are unused
   from 2.0.6 — the hero no longer renders them; the shared .landing-links
   rules stay for landing.php.) */
.topnav { flex: none; }
.brand { min-width: 0; }
.brand-mark { flex: none; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-links { list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.top-links li { display: flex; }
.tlink { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 600 13px/1 var(--font); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.tlink:hover { transform: translateY(-1px); border-color: var(--muted); box-shadow: var(--shadow); }
.tlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tlink .tlic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--b, #6d6a73); color: #fff; flex: none; }
.tlink .tlic img { width: 15px; height: 15px; border-radius: 4px; object-fit: cover; }
@media (max-width: 640px) {
  .top-links { gap: 4px; }
  .topnav .btn-accent { display: none; }
  .tlink { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
  .tlink .tlabel { display: none; }
  .tlink .tlic { width: 26px; height: 26px; }
}
@media (max-width: 480px) {
  .topbar-in { padding: 0 12px; gap: 8px; }
  .topnav { gap: 4px; }
  .tlink { width: 32px; height: 32px; }
}
