/* /style.css */
:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.5;
  color: #142b26;
  background: #f0f5ee;
  --ink: #142b26;
  --muted: #53665f;
  --link: #19614e;
  --accent: #d4eb8b;
  --edge: #dce6de;
  --soft: #f3f7f2;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:active:not(:disabled) { filter: brightness(.93); }
button {
  cursor: pointer; padding: 8px 13px; border: 1px solid #c9d8ce; border-radius: 8px;
  background: #fff; color: var(--ink); font-weight: 700;
}
button:hover { background: #ebf3eb; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #53947f; outline-offset: 2px; }
a { color: var(--link); text-underline-offset: 3px; }
input, select { padding: 8px 10px; background: #fff; border: 1px solid #c4d5ca; border-radius: 8px; min-width: 0; width: 100%; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; letter-spacing: -.035em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
img { max-width: 100%; display: block; }
.masthead { background: #18372f; color: #fff; }
.mast-inner { max-width: 1190px; margin: auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; gap: 12px; }
.wordmark { color: #fff; font-size: 25px; font-weight: 900; letter-spacing: -.09em; text-decoration: none; line-height: 1.15; white-space: nowrap; }
.panel { padding: 14px; background: #fff; border: 1px solid var(--edge); border-radius: 13px; min-width: 0; }
.panel h2 { padding-bottom: 6px; }
dialog { background: #fff; color: var(--ink); border: 1px solid var(--edge); border-radius: 14px; padding: 0; width: min(580px, calc(100% - 24px)); max-height: 90dvh; box-shadow: 0 12px 50px #122c2447; overflow: auto; }
dialog::backdrop { background: #18362ba6; }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; background: #f4f8f3; border-bottom: 1px solid var(--edge); padding: 8px 13px; }
.dialog-head button { width: 42px; height: 42px; padding: 0; font-size: 21px; }
.dialog-body { display: grid; gap: 11px; padding: 13px; }
.resident-choice { display: flex; align-items: center; text-align: left; gap: 10px; padding: 8px; }
.resident-choice[aria-pressed=true], .image-option[aria-pressed=true] { outline: 2px solid #36896d; outline-offset: -2px; background: #edf5e9; }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 9px; }
.image-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; max-height: 205px; overflow: auto; padding: 2px; }
.image-option { min-width: 0; padding: 4px; font-size: 11px; line-height: 1.33; }
.image-option img { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: 4px; border-radius: 5px; }
.preview { background: #f2f7ed; padding: 8px 10px; border: 1px solid #deeadc; border-radius: 8px; }
.preview-card { display: grid; grid-template-columns: 1fr minmax(80px, 38%); gap: 5px; align-items: center; }
.preview img { max-height: 120px; margin-left: auto; border-radius: 6px; }
.compose-identity { display:flex; align-items:center; gap:10px; min-height:48px; padding-bottom:2px; }
.compose-avatar { width:42px; height:42px; flex:0 0 42px; overflow:hidden; border-radius:50%; background:#e9f0f4; }
.compose-avatar .avatar { width:100%; height:100%; border-radius:0; }
.compose-caption { display:block; color:var(--muted); font-size:12px; font-weight:400; }
.compose-selection { margin:-3px 0 0; color:var(--muted); font-size:12px; }
.compose-phrase { border-top:1px solid var(--edge); padding-top:10px; }
#compose-form[aria-busy=true] { pointer-events:none; }
#compose-form[aria-busy=true] #publish { opacity:.72; }
#compose-error, .image-unavailable { color: #8c3535; font-size: 13px; padding: 4px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 15px; z-index: 5; background: #17392e; color: #fff; padding: 10px 15px; border-radius: 9px; width: max-content; max-width: calc(100% - 24px); }
.back-to-feed { color: #fff; font-size: 13px; }
.dashboard { max-width: 880px; margin: 20px auto 48px; padding: 0 15px; }
.dashboard h1 { margin-bottom: 10px; }
.dashboard .panel { margin: 0 0 12px; }
.dashboard #login { max-width: 440px; display: grid; gap: 8px; }
#status { background: #eef6d7; padding: 8px 12px; margin-bottom: 12px; border-radius: 8px; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.schedule { margin-top: 10px; }
details { margin: 8px 0; }
summary { cursor: pointer; font-weight: 700; color: var(--link); }
#signature-preview img { max-height: 260px; width: auto; margin-top: 8px; }
.admin-list { display: grid; gap: 8px; }
.moderation-row, .asset-row { display: flex; align-items: center; gap: 9px; justify-content: space-between; border-top: 1px solid var(--edge); padding: 8px 0; }
.draft { border: 1px solid var(--edge); border-radius: 9px; padding: 10px; }
.draft > img { max-height: 205px; object-fit: contain; margin-top: 8px; border-radius: 6px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.asset-table { margin: 10px 0; }
.asset-row img, .hidden-indicator { flex: 0 0 62px; width: 62px; height: 48px; object-fit: cover; }
.asset-row > div { flex: 1; min-width: 0; }
.asset-row code { font-size: 10px; display: block; overflow-wrap: anywhere; }
.asset-row button, .moderation-row button { flex: 0 0 auto; font-size: 12px; }
#muse-switches { margin-top: 8px; }
#muse-switches button[aria-pressed=true] { border-color: #86b396; background: #e1efdc; }
.draft-image-review { margin: 8px 0; display: grid; justify-items: start; gap: 6px; }
.draft-image-review img { max-height: 280px; }
.review-check { display: flex; gap: 8px; align-items: start; }
.review-check input { flex: 0 0 16px; width: 16px; }
:root { --ink:#101d2b; --muted:#526371; --edge:#dbe1e5; --link:#135781; --blue:#08699e; color:var(--ink); background:#f6f8fa; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; clip-path:inset(50%); overflow:hidden; }
.icon-sprite { position:absolute; }
.stream-shell { display:grid; grid-template-columns:205px minmax(0,610px); gap:26px; max-width:900px; margin:auto; padding:0 20px; align-items:start; }
.rail { position:sticky; top:0; padding:25px 8px; display:grid; gap:9px; }
.rail .wordmark { color:var(--ink); font-size:29px; margin:0 0 25px 9px; }
.glyph { width:23px; height:23px; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; fill:none; flex:none; }
.nav-item, .rail-post { display:flex; align-items:center; gap:14px; padding:12px; border:none; border-radius:24px; background:transparent; font-size:16px; }
.nav-item:hover, .text-button:hover { background:#eaf1f6; }
[data-act=home] { font-weight:800; }
.primary, .rail-post { background:var(--blue); color:white; border:0; }
.primary:hover { background:#06557f; }
.rail-post { justify-content:center; margin-top:14px; }
.admin-link { margin:24px 12px; font-size:12px; }
.mobile-nav { display:none; }
.timeline { min-height:100vh; min-width:0; background:white; border-inline:1px solid var(--edge); }
.stream-head { position:sticky; top:0; z-index:2; background:rgba(255,255,255,.97); border-bottom:1px solid var(--edge); }
.stream-title { display:flex; align-items:center; justify-content:space-between; padding:6px 16px 0; min-height:48px; }
.stream-title h1 { font-size:23px; font-weight:850; letter-spacing:-.07em; }
#timeline-home { display:inline-flex; align-items:center; gap:6px; min-height:44px; color:var(--blue); text-decoration:none; font-size:14px; }
#timeline-home:hover { text-decoration:underline; }
.missing-post { width:min(100%,540px); margin:14dvh auto; padding:24px; }
.missing-post p { color:var(--muted); margin-bottom:8px; }
.missing-post a { display:inline-flex; align-items:center; min-height:44px; margin-top:12px; }
#filter-toggle { display:grid; place-items:center; width:44px; height:44px; background:none; border:0; border-radius:50%; }
#filter-toggle:hover, #filter-toggle.filtered { color:var(--blue); background:#e7f3fa; }
#filter-toggle .glyph { width:20px; }
.tabs { display:grid; grid-template-columns:1fr 1fr; }
.tabs button { position:relative; border:0; background:none; min-height:44px; color:var(--muted); border-radius:0; }
.tabs button[aria-pressed=true] { color:var(--ink); }
.tabs button[aria-pressed=true]::after { content:""; position:absolute; left:calc(50% - 20px); bottom:0; width:40px; height:3px; border-radius:3px; background:var(--blue); }
.browse-filters { display:flex; overflow-x:auto; gap:6px; padding:7px 12px; border-bottom:1px solid var(--edge); }
.filter-chip { white-space:nowrap; min-height:40px; font-size:13px; border-radius:20px; }
.filter-chip[aria-pressed=true] { color:#fff; background:#273947; border-color:#273947; }
.card { padding:15px 18px 4px 70px; border-bottom:1px solid var(--edge); position:relative; }
.card-byline { display:flex; align-items:center; min-height:35px; gap:8px; }
.card-byline strong { font-size:15px; }
.avatar { width:38px; height:38px; flex:none; object-fit:cover; border-radius:50%; background:#e9f0f4; }
.card-byline > .avatar { position:absolute; top:15px; left:17px; }
.blank-avatar { display:grid; place-items:center; background:var(--soft); color:var(--muted); overflow:hidden; border-radius:50%; }
.meta, .muted, .post-link { color:var(--muted); font-size:12px; }
.post-link { text-decoration:none; }
.post-link:hover { text-decoration:underline; }
.post-body, .image-caption { margin:8px 0; overflow-wrap:anywhere; white-space:pre-wrap; line-height:1.6; }
.feed-image { display:block; max-width:100%; height:auto; max-height:clamp(270px,54dvh,480px); border-radius:13px; border:1px solid #17293a19; margin:8px 0 1px; object-fit:contain; }
.feed-image[role=button] { cursor:zoom-in; }
.feed-image:focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
.card-actions, .reactions, .original-links { display:flex; align-items:center; gap:4px 12px; }
.card-actions { flex-wrap:wrap; justify-content:space-between; }
.original-links { flex-wrap:wrap; font-size:12px; }
.original-links a, .text-button { display:inline-flex; align-items:center; min-height:44px; }
.original-links a { color:var(--muted); text-decoration:none; }
.original-links a:hover { text-decoration:underline; }
.text-button { border:0; background:transparent; padding:0 7px; color:var(--muted); }
.like { min-width:44px; font-size:15px; }
.like[aria-pressed=true], .danger { color:#a52953; }
.post-menu { position:relative; margin:0; }
.post-menu summary { list-style:none; display:grid; width:44px; height:44px; place-items:center; color:var(--muted); }
.post-menu summary::-webkit-details-marker { display:none; }
.post-menu-items { position:absolute; z-index:2; left:0; bottom:calc(100% - 4px); padding:3px 6px; display:grid; min-width:100px; background:#fff; border:1px solid var(--edge); border-radius:12px; box-shadow:0 6px 22px #0d1c3020; }
.source-reaction { margin-left:auto; color:var(--muted); font-size:11px; }
.reply-card { margin:0 0 10px; padding:8px 0 0 12px; border-left:2px solid var(--edge); }
.reply-byline { display:flex; align-items:center; gap:7px; }
.reply-byline .avatar { width:24px; height:24px; }
.more-row, .empty { text-align:center; padding:28px 14px; color:var(--muted); }
.more-row { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; }
.more-row button { border-radius:22px; color:var(--blue); min-height:44px; }
.refresh-row { display:none; }
#refresh-feed { min-height:44px; padding:0 9px; border:1px solid var(--edge); border-radius:999px; background:var(--paper); color:var(--link); font-size:13px; font-weight:700; }
#refresh-feed::before { content:'↻'; margin-right:6px; font-size:16px; }
#refresh-feed:hover:not(:disabled), #refresh-feed:focus-visible { background:var(--soft); }
#refresh-feed:disabled { cursor:wait; opacity:.7; }
.pull-zone { display:none; }
html { overscroll-behavior-y:contain; touch-action:manipulation; }
@media (pointer:coarse) {
  body :is(input,select,textarea) { font-size:max(16px,1rem); }
}
.dialog-head { background:white; }
.preview { background:#f3f7fa; }
.dialog-body select, .dialog-body input { font-size:16px; }
@media(max-width:700px) {
  :root { background:#fff; }
  .stream-shell { display:block; max-width:540px; padding:0; margin:0 auto calc(72px + env(safe-area-inset-bottom)); }
  .rail { display:none; }
  .timeline { border:0; }
  .stream-title { padding:4px 12px 0 16px; }
  .card { padding:12px 12px 2px 56px; }
  .card-byline > .avatar { top:14px; left:10px; width:36px; height:36px; }
  .feed-image { max-height:48dvh; }
  .mobile-nav { position:fixed; z-index:4; bottom:0; left:0; right:0; display:flex; justify-content:space-evenly; background:#fffffff7; border-top:1px solid var(--edge); padding:3px 8px max(3px,env(safe-area-inset-bottom)); }
  .mobile-nav .nav-item { flex:1; justify-content:center; flex-direction:column; gap:1px; padding:4px 3px; min-height:48px; font-size:10px; }
  dialog { max-height:89dvh; }
  dialog#compose-dialog { width:100%; max-width:100%; margin:auto 0 0; border-radius:18px 18px 0 0; }
  .dialog-body { padding:12px 14px max(14px,env(safe-area-inset-bottom)); }
  .image-grid { max-height:clamp(150px,30dvh,250px); grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .image-option { min-height:100px; }
  .compose-selection { margin-top:-2px; }
  #compose-form #publish { min-height:44px; }
  #toast { bottom:calc(72px + env(safe-area-inset-bottom)); }
}
.messages-dialog { width:min(660px,calc(100vw - 32px)); height:min(760px,88dvh); max-height:none;
  padding:0; overflow:hidden; border-color:var(--edge); border-radius:20px; box-shadow:0 20px 70px rgb(13 34 49 / .24); }
.messages-dialog[open] { display:flex; flex-direction:column; }
.messages-dialog::backdrop { background:#101d2b70; }
html:has(.messages-dialog[open], .image-viewer[open]) { overflow:hidden; }
.messages-head, .messages-foot { flex:none; background:var(--paper); }
.messages-head { position:relative; z-index:2; display:flex; align-items:center; gap:8px; padding:7px 14px; min-height:64px; border-bottom:1px solid var(--edge); box-shadow:0 1px 8px rgb(13 34 49 / .06); }
.messages-head h2 { flex:1; min-width:0; line-height:1.35; font-size:18px; overflow-wrap:anywhere; }
.messages-head button { border:0; background:transparent; color:var(--blue); min-height:44px; padding:0 9px; border-radius:22px; white-space:nowrap; }
.messages-body { position:relative; flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; overflow-anchor:none; scrollbar-gutter:stable; }
.messages-foot { position:relative; z-index:2; border-top:1px solid var(--edge); padding:10px 16px max(10px,env(safe-area-inset-bottom)); box-shadow:0 -1px 8px rgb(13 34 49 / .05); }
.messages-foot:empty { display:none; }
.messages-dialog button:focus-visible, .messages-dialog select:focus-visible, .messages-dialog input:focus-visible {
  outline:2px solid var(--blue); outline-offset:-2px; }
.messages-dialog :is(input,select) { font-size:16px; min-height:44px; border:1px solid var(--edge); }
.message-thread-row { display:flex; align-items:center; gap:12px; width:100%; min-height:76px; padding:12px 16px;
  border:0; border-bottom:1px solid var(--edge); border-radius:0; background:#fff; text-align:left; }
.message-thread-row { transition:background-color .16s ease; }
.message-thread-row:hover, .message-thread-row:focus-visible { background:#f5f8fa; }
.message-avatar { width:44px; height:44px; flex:0 0 44px; border-radius:50%; object-fit:cover; background:#eaf0f4; }
.messages-head .message-avatar { width:34px; height:34px; flex-basis:34px; }
.message-preview, .message-time { color:var(--muted); font-weight:400; }
.message-preview { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.message-time { white-space:nowrap; font-size:12px; }
.message-list { display:flex; flex-direction:column; padding:16px 18px 24px; }
.message-own,.message-other { width:fit-content; max-width:85%; margin:0 0 6px; padding:9px 13px; line-height:1.5;
  overflow-wrap:anywhere; white-space:pre-wrap; }
.message-own { margin-left:auto; border-radius:17px 17px 5px 17px; background:var(--blue); color:white; }
.message-other { margin-right:auto; border-radius:17px 17px 17px 5px; background:#eef2f5; }
.message-own + .message-own, .message-other + .message-other { margin-top:-2px; }
.message-older, .message-newer { display:block; margin:0 auto 12px; min-height:44px; border-radius:24px; color:var(--blue); }
.message-older { background:transparent; border:0; font-size:13px; }
.message-newer { background:#fff; border:1px solid var(--edge); box-shadow:0 2px 8px #17324815; }
.message-send { min-height:44px; border:0; border-radius:24px; background:var(--blue); color:#fff; padding-inline:18px; }
.message-send:not(:disabled):hover { background:#075a89; }
.messages-dialog .form-error { color:#973d48; font-size:14px; }
.messages-head .messages-close { width:44px; padding:0; font-size:25px; color:var(--muted); }
.messages-head .message-back { width:44px; font-size:22px; color:var(--ink); }
.message-thread-info { flex:1; min-width:0; }
.message-row-head { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.message-row-head strong { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.message-preview { margin-top:3px; }
.message-empty { padding:clamp(38px,14dvh,115px) 24px; text-align:center; }
.message-empty h3 { font-size:19px; }
.message-empty p,.message-loading,.message-intro { margin:8px 0; color:var(--muted); font-size:14px; }
.message-intro,.message-loading { text-align:center; padding:16px; }
.message-compose,.message-own-code { padding:22px 18px; }
.message-compose { border-bottom:1px solid var(--edge); }
.message-compose label,.message-own-code h3 { font-size:15px; font-weight:700; margin-bottom:9px; }
.message-code-row,.message-reply-form { display:flex; align-items:center; gap:8px; }
.message-code-row button { flex:none; min-height:44px; border-radius:22px; }
.message-code-row input,.message-reply-form select { border-radius:12px; background:#f7f9fb; min-width:0; }
.message-lookup { color:var(--blue); }
.message-own-code .message-code-row { justify-content:space-between; }
.message-own-code code { user-select:all; overflow-wrap:anywhere; }
.message-login { display:inline-flex; align-items:center; margin:0 18px; min-height:44px; }
.message-day { margin:14px auto; text-align:center; font-size:12px; color:var(--muted); }
.bubble-time { display:inline-block; margin-left:8px; font-size:11px; white-space:nowrap; }
.message-other .bubble-time { color:var(--muted); }
.message-list:empty { display:none; }
.message-older { margin:4px auto 0; }
.message-newer { position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%); margin:0; }
.message-status { margin:0; padding:8px 16px; font-size:14px; }
.message-reply-form select { flex:1; }
/* Desktop keeps the inbox visible while a conversation is open. */
.desktop-messages-sidebar { display:none; }
@media (min-width:701px) {
  .messages-dialog[data-layout="split"] {
    display:grid;
    grid-template-columns:minmax(220px,270px) minmax(0,1fr);
    grid-template-rows:64px minmax(0,1fr) auto;
    width:min(900px,calc(100vw - 64px));
  }
  .messages-dialog[data-layout="split"] .messages-head {
    grid-column:2;
    grid-row:1;
    min-width:0;
  }
  .messages-dialog[data-layout="split"] .messages-body {
    grid-column:2;
    grid-row:2;
    min-width:0;
  }
  .messages-dialog[data-layout="split"] .messages-foot {
    grid-column:2;
    grid-row:3;
    min-width:0;
  }
  .messages-dialog[data-layout="split"] .message-status {
    position:absolute;
    z-index:3;
    top:64px;
    right:0;
    left:270px;
    background:var(--paper);
  }
  .messages-dialog[data-layout="split"] .desktop-messages-sidebar {
    display:block;
    grid-column:1;
    grid-row:1 / -1;
    min-width:0;
    overflow-y:auto;
    overscroll-behavior:contain;
    border-right:1px solid var(--edge);
    background:var(--paper);
  }
  .desktop-messages-sidebar h3 {
    position:sticky;
    top:0;
    z-index:1;
    margin:0;
    padding:18px 16px 12px;
    background:var(--paper);
    border-bottom:1px solid var(--edge);
    font-size:17px;
  }
  .desktop-messages-sidebar .message-thread-row {
    min-height:70px;
    padding:10px 12px;
  }
  .desktop-messages-sidebar .message-thread-row[aria-current="true"] {
    background:var(--soft);
  }
}
@media(max-width:700px) {
  .messages-dialog[open] { position:fixed; inset:var(--dm-top,0px) 0 auto; width:100%; max-width:100%; height:var(--dm-height,100dvh);
    margin:0; border:0; border-radius:0; padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom); }
  .messages-head { min-height:58px; padding-inline:10px; }
  .messages-body { scrollbar-width:none; }
  .messages-body::-webkit-scrollbar { display:none; }
  .messages-foot { padding-inline:12px; padding-bottom:10px; }
  .message-thread-row { min-height:72px; padding-inline:14px; }
  .message-list { padding-inline:12px; }
  .message-own, .message-other { max-width:min(82%,320px); }
}
.account-option { padding:10px 16px 14px; border-top:1px solid var(--edge); font-size:13px; color:var(--muted); }
.account-option a { display:inline-flex; align-items:center; min-height:44px; }
.image-viewer { width:100vw; max-width:none; height:100dvh; max-height:none; padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); border:0; border-radius:0; background:#000; overflow:hidden; place-items:center; }
.image-viewer::backdrop { background:#000; }
.image-viewer[open] { display:grid; }
.image-viewer img { display:block; max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; touch-action:pinch-zoom; user-select:none; }
.image-viewer-close { position:absolute; z-index:1; top:max(12px,env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:50%; color:#fff; background:#ffffff2b; font-size:30px; line-height:1; }
.image-viewer-close:hover, .image-viewer-close:focus-visible { background:#ffffff55; }
/* Keep attribution below the picture, including on a short landscape screen. */
.image-viewer[open] { grid-template-rows:minmax(0,1fr) auto; }
.image-viewer-sources { width:100%; max-height:30dvh; overflow:auto; padding:4px 12px max(4px,env(safe-area-inset-bottom)); color:white; }
.image-viewer-sources .original-links { justify-content:center; }
.image-viewer-sources .original-links a { display:inline-flex; align-items:center; min-height:44px; padding-inline:8px; color:white; text-decoration:underline; }
.caption-origin { display:block; font-size:.76em; color:var(--muted); }
.caption-origin a { color:inherit; text-decoration:none; }
.caption-origin a:hover { text-decoration:underline; }
.archive-caption { margin:3px 0 7px; }
.archive-caption .post-body { white-space:pre-wrap; overflow-wrap:anywhere; margin:2px 0; }

.desktop-topics {
  --featured-accent:var(--link);
  --featured-line:var(--photo-edge,var(--edge));
  --featured-muted:var(--photo-muted,var(--muted));
}
.featured-link {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:baseline;
  gap:4px 10px;
  min-height:48px;
  padding:9px 0 12px;
  color:inherit;
  text-decoration:none;
  overflow-wrap:anywhere;
}
.desktop-topics .featured-link + .featured-link { border-top:1px solid var(--featured-line); }
.featured-scene { grid-column:1 / -1; font-size:1.06rem; line-height:1.45; }
.featured-byline, .featured-count { color:var(--featured-muted); font-size:.81rem; }
.featured-count strong { color:inherit; font-variant-numeric:tabular-nums; }
.featured-action { grid-column:1 / -1; padding-top:3px; color:var(--featured-accent); font-size:.88rem; font-weight:650; }
.featured-link:is(:hover,:focus-visible) .featured-action { text-decoration:underline; }
.featured-link:focus-visible { outline:2px solid var(--featured-accent); outline-offset:3px; border-radius:4px; }
@media (max-width:359px) {
  .featured-link { grid-template-columns:minmax(0,1fr); }
}

original-post-embed { display:block; min-width:0; min-height:56px; }
original-post-embed + original-post-embed { margin-top:10px; }
.original-post-frame { display:block; min-width:0; min-height:0; }
.original-post-retry { border:0; padding:0; background:none; font:inherit; cursor:pointer; }
original-post-embed iframe { display:block; width:100%; max-width:100%; border:0; }
.original-post-fallback { display:grid; gap:6px; min-height:52px; padding:10px 12px; color:var(--muted); }
.original-post-preview { min-width:0; }
.original-post-preview:empty { display:none; }
.original-post-excerpt-label { font-size:.72rem; }
.original-post-excerpt { margin:4px 0 0; color:var(--text); overflow-wrap:anywhere; }
.original-post-preview-image { display:block; width:100%; max-height:420px; height:auto; object-fit:contain; border-radius:8px; margin-top:8px; }
.original-post-preview-controls { display:flex; align-items:center; flex-wrap:wrap; gap:0 14px; }
.original-post-status { font-size:.78rem; }
.original-post-fallback .original-post-link { min-height:40px; }
/* The fallback link must stay usable while a cross-origin iframe is pending.
   Keep the iframe measurable at full width, but out of document flow until
   X confirms that it rendered. */
original-post-embed[aria-busy="true"] { position:relative; min-height:56px; overflow:hidden; }
original-post-embed[aria-busy="true"] .original-post-frame { position:absolute; inset:0 0 auto; width:100%; height:100%; overflow:hidden; opacity:0; pointer-events:none; }
original-post-embed:not([aria-busy]) .original-post-frame { position:static; width:auto; height:auto; overflow:visible; }
.original-post-link {
  display:flex; align-items:center; gap:.35em; min-height:44px; width:fit-content;
  max-width:100%; color:var(--link); font-size:.9rem; text-underline-offset:.2em;
}
.original-post-link:focus-visible { outline:2px solid currentColor; outline-offset:2px; }

.face-loader {
  display:inline-block; flex:none; width:2rem; height:2rem; border-radius:50%;
  background:var(--soft) url('/release/face.webp') center / cover no-repeat;
  animation:face-turn 1.25s linear infinite;
}
@keyframes face-turn { to { transform:rotate(1turn); } }
@media(prefers-reduced-motion:reduce) { .face-loader { animation:none; } }
.timeline-loading {
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  text-align:center; font-size:.82rem; color:var(--muted);
}
.timeline-loading { min-height:clamp(180px,36dvh,320px); }
original-post-embed[data-embed-state="idle"], original-post-embed[data-embed-state="loading"] {
  min-height:var(--embed-height,clamp(255px,78vw,380px));
}
original-post-embed[data-embed-state="loading"] .original-post-fallback { min-height:inherit; align-content:center; }
.original-post-status { display:inline-flex; align-items:center; gap:9px; }
.original-post-fallback[hidden] { display:none; }

#filter-toggle { display:inline-flex; width:auto; gap:5px; border-radius:999px; align-items:center; padding:0 10px; color:var(--muted); font:inherit; font-size:.82rem; }
#filter-toggle.filtered { color:var(--link); }
#filter-toggle .glyph { width:17px; }
#compose-form { min-width:0; }
#compose-dialog .filters { grid-template-columns:minmax(0,1fr) minmax(5rem,auto); }
#compose-dialog .compose-phrase { min-width:0; }
#compose-dialog select,#compose-dialog input { max-width:100%; min-width:0; font-size:16px; }
#compose-dialog #publish { width:100%; min-height:44px; }
@media(min-width:701px) {
  #compose-dialog { width:min(640px,94vw); }
  #compose-dialog #image-grid { max-height:clamp(160px,29vh,300px); }
}

@media(max-width:959px) {
  .more-row { position:relative; padding:0; min-height:1px; }
  .more-row button:not(:focus-visible) { position:absolute; width:1px; height:1px; min-height:0; padding:0; clip-path:inset(50%); overflow:hidden; }
  .refresh-row:not([hidden]) { display:flex; justify-content:center; }
  .pull-zone { display:flex; align-items:center; justify-content:center; width:100%; height:var(--pull-height,0px); overflow:hidden; user-select:none; transition:height 180ms ease-out; }
  .refresh-row.is-pulling .pull-zone { transition:none; }
  .refresh-row.is-pulling.is-refreshing .pull-zone { height:40px; }
  .pull-zone .face-loader { width:24px; height:24px; }
  .refresh-row:not(.is-refreshing) .face-loader { animation:none; }
  .timeline { min-height:100svh; }
}
@media(max-width:959px) and (prefers-reduced-motion:reduce) {
  .pull-zone { transition:none; }
}


@media (max-width:700px) {
  .stream-head .site-ca { flex-wrap:nowrap; min-width:0; }
  .stream-head .site-ca-value { flex:1 1 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .stream-head .site-ca-status { width:auto; flex:0 0 auto; }
}
@media (max-width:700px) and (max-height:560px) {
  html[data-surface="timeline"] .stream-title { min-height:48px; padding-top:0; }
  html[data-surface="timeline"] .stream-head .site-ca { padding-block:3px; }
}

/* /display.css */
/* User display preferences. Loaded after style.css so the same tokens serve
   the timeline, account screens, dialogs, and messages. */
:root {
  --action-bg: var(--blue);
  --action-fg: #fff;
}

html[data-scheme="light"] {
  color-scheme: light;
  --paper: #fff;
  --soft: #f3f7f2;
  --ink: #101d2b;
  --muted: #526371;
  --edge: #dbe1e5;
  --link: #135781;
  --blue: #08699e;
  --action-bg: #08699e;
  --action-fg: #fff;
}

html[data-scheme="dark"] {
  color-scheme: dark;
  --paper: #17232d;
  --soft: #1c2b35;
  --ink: #edf4f5;
  --muted: #b4c4c8;
  --edge: #3a4b54;
  --link: #8dccf1;
  --blue: #72b9df;
  --action-bg: #8dccf1;
  --action-fg: #10212c;
}

html[data-scheme="dark"] body,
html[data-scheme="dark"] .timeline,
html[data-scheme="dark"] .stream-head,
html[data-scheme="dark"] .rail,
html[data-scheme="dark"] .mobile-nav {
  color: var(--ink);
  background: var(--paper);
}

html[data-scheme="dark"] .stream-shell,
html[data-scheme="dark"] .card,
html[data-scheme="dark"] .browse-filters,
html[data-scheme="dark"] .refresh-row {
  background: var(--paper);
  border-color: var(--edge);
}

html[data-scheme="dark"] button,
html[data-scheme="dark"] input,
html[data-scheme="dark"] select,
html[data-scheme="dark"] textarea {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--edge);
}

html[data-scheme="dark"] .primary,
html[data-scheme="dark"] .message-send {
  color: var(--action-fg);
  background: var(--action-bg);
}

html[data-scheme="dark"] .tabs button,
html[data-scheme="dark"] .nav-item,
html[data-scheme="dark"] .text-button,
html[data-scheme="dark"] .refresh-row button,
html[data-scheme="dark"] #filter-toggle {
  color: var(--ink);
}

html[data-scheme="dark"] a,
html[data-scheme="dark"] .post-link,
html[data-scheme="dark"] .original-links a,
html[data-scheme="dark"] .message-lookup,
html[data-scheme="dark"] .message-login,
html[data-scheme="dark"] .message-newer,
html[data-scheme="dark"] .message-older {
  color: var(--link);
}

html[data-scheme="dark"] .meta,
html[data-scheme="dark"] .muted,
html[data-scheme="dark"] .message-preview,
html[data-scheme="dark"] .message-time,
html[data-scheme="dark"] .bubble-time {
  color: var(--muted);
}

html[data-scheme="dark"] .post-menu-items,
html[data-scheme="dark"] .preview,
html[data-scheme="dark"] .dialog-head,
html[data-scheme="dark"] .messages-head,
html[data-scheme="dark"] .messages-foot,
html[data-scheme="dark"] .message-thread-row,
html[data-scheme="dark"] .message-newer {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--edge);
}

html[data-scheme="dark"] .message-other {
  color: var(--ink);
  background: #293942;
}

html[data-scheme="dark"] .message-own {
  color: #08161e;
  background: #8dccf1;
}

html[data-scheme="dark"] dialog,
html[data-scheme="dark"] .messages-dialog {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--edge);
}

html[data-scheme="dark"] dialog::backdrop {
  background: #000b;
}

html[data-scheme="dark"] .resident-choice[aria-pressed="true"],
html[data-scheme="dark"] .image-option[aria-pressed="true"] {
  color: var(--ink);
  background: #29453d;
}

html[data-scheme="dark"] .image-grid,
html[data-scheme="dark"] .image-option,
html[data-scheme="dark"] .message-compose,
html[data-scheme="dark"] .message-own-code,
html[data-scheme="dark"] .message-list,
html[data-scheme="dark"] .message-empty {
  background: var(--paper);
}


html[data-surface="account"] body {
  background: var(--soft);
}

html[data-surface="account"] .panel,
html[data-surface="account"] .account-card,
html[data-surface="account"] .settings-card,
html[data-surface="account"] form {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--edge);
}

html[data-surface="account"] .primary,
html[data-surface="account"] [type="submit"],
html[data-surface="account"] .action-button {
  color: var(--action-fg);
  background: var(--action-bg);
}

html[data-text="large"] body {
  font-size: 17px;
}

html[data-text="large"] .post-body,
html[data-text="large"] .image-caption,
html[data-text="large"] .message-own,
html[data-text="large"] .message-other,
html[data-text="large"] .message-preview,
html[data-text="large"] .dialog-body,
html[data-text="large"] .settings-card,
html[data-text="large"] .account-card {
  font-size: 1.08em;
}

html[data-text="large"] .meta,
html[data-text="large"] .muted,
html[data-text="large"] .message-time,
html[data-text="large"] .bubble-time {
  font-size: 0.92em;
}

/* The inbox and the feeds share the height of their bottom navigation. */
@media (max-width:700px) {
  html[data-surface="messages"] .inbox-pane .inbox-conversation {
    height:calc(var(--dm-height,100dvh) - var(--bottom-nav-height,calc(80px + env(safe-area-inset-bottom))));
  }
  html[data-surface="timeline"] .stream-shell {
    margin-bottom:calc(var(--bottom-nav-height,80px) + 8px);
  }
  html[data-surface="photos"] .photos-layout {
    padding-bottom:calc(var(--bottom-nav-height,84px) + 8px);
  }
}

html[data-text="large"] button,
html[data-text="large"] input,
html[data-text="large"] select,
html[data-text="large"] textarea {
  font-size: 1em;
}

@media (max-width: 700px) {
  html[data-text="large"] .card {
    padding-top: 15px;
    padding-bottom: 5px;
  }

  html[data-text="large"] .mobile-nav .nav-item {
    font-size: 11px;
  }

  html[data-text="large"] .messages-head {
    min-height: 64px;
  }
}

/* Profiles and settings share the same column and navigation as the timeline. */
.nav-item, html[data-scheme="dark"] a.nav-item { color:var(--ink); text-decoration:none; }
.nav-item[aria-current="page"] { font-weight:800; }
html[data-surface="account"] body:not(.account-ready) .timeline > * { visibility:hidden; }
.account-page { color:var(--ink); background:var(--paper); padding-bottom:5rem; }
.account-page :is(a,button,input,select,summary):focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
.account-head { position:sticky; top:0; z-index:2; min-height:54px; display:flex; align-items:center; gap:8px; padding:4px 12px 4px 6px; background:var(--paper); border-bottom:1px solid var(--edge); }
.account-head h1 { flex:1; min-width:0; font-size:1.15rem; color:var(--ink); }
.account-icon { display:grid; place-items:center; width:44px; height:44px; flex:none; border-radius:50%; }
.account-icon, html[data-scheme="dark"] .account-icon { color:var(--ink); }
.account-icon:hover, .settings-row:hover { background:var(--soft); }
.account-notice { margin:12px 16px 0; color:var(--link); overflow-wrap:anywhere; }
.account-action, .account-outline, .account-quiet { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:7px 15px; border-radius:99px; font-weight:700; text-decoration:none; text-align:center; }
.account-outline, html[data-scheme="dark"] .account-outline { color:var(--ink); background:var(--paper); border:1px solid var(--edge); }
.account-quiet, html[data-scheme="dark"] .account-quiet { color:var(--link); background:transparent; border:0; }
.account-page .account-action, html[data-scheme="dark"] .account-page .account-action { color:var(--paper); background:var(--ink); border:0; }
.profile-cover { width:100%; aspect-ratio:3.2; overflow:hidden; background:var(--soft); border-bottom:1px solid var(--edge); }
.profile-cover img { width:100%; height:100%; object-fit:cover; object-position:50% 32%; }
.profile-summary { padding:0 18px 15px; overflow-wrap:anywhere; }
.profile-topline { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.profile-topline > .avatar { width:clamp(74px,15vw,94px); height:auto; aspect-ratio:1; border:4px solid var(--paper); margin-top:clamp(-44px,-7vw,-32px); position:relative; }
.profile-actions { display:flex; justify-content:flex-end; align-items:center; gap:4px; margin-top:8px; flex-wrap:wrap; }
.share-profile { display:grid; place-items:center; width:44px; height:44px; padding:0; border-radius:50%; border:1px solid var(--edge); color:var(--ink); background:var(--paper); }
.share-profile .glyph { width:20px; height:20px; }
.profile-identity { margin:8px 0; line-height:1.32; }
.profile-identity h2 { font-size:1.35rem; letter-spacing:-.025em; }
.profile-handle, .profile-count, .profile-kind, .profile-post-meta span { color:var(--muted); }
.profile-kind, .profile-count { font-size:.86em; }
.profile-count { margin-top:10px; }
.profile-count strong { color:var(--ink); margin-right:3px; }
.profile-kind + .profile-bio { margin-top:6px; }
.profile-bio { white-space:pre-wrap; }
.profile-tabs { border-bottom:1px solid var(--edge); }
.profile-post { display:grid; grid-template-columns:40px minmax(0,1fr); align-items:start; gap:10px; padding:14px 16px; border-bottom:1px solid var(--edge); }
.profile-post-meta { display:flex; align-items:baseline; gap:6px; flex-wrap:wrap; }
.profile-post-meta span { font-size:.8em; }
.profile-post-inner > a { display:block; }
.profile-post-image { border:1px solid var(--edge); border-radius:14px; margin:8px 0; max-height:28rem; width:auto; height:auto; max-width:100%; object-fit:contain; }
.profile-media { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:3px; padding:3px 0; }
.profile-tile { width:100%; height:100%; object-fit:cover; }
.profile-tile-link { display:block; aspect-ratio:1; overflow:hidden; }
.profile-guest, .account-empty { padding:24px 18px; }
.profile-guest h2, .account-empty h2 { font-size:1.2rem; }
.profile-guest p { margin:6px 0 16px; color:var(--muted); }
.account-empty :is(a,button) { margin:16px 8px 0 0; }
.edit-identity { display:flex; align-items:flex-end; gap:10px; padding:0 16px 14px; }
.edit-identity .avatar { width:66px; height:66px; margin-top:-22px; border:3px solid var(--paper); position:relative; }
.edit-identity strong { padding-bottom:8px; }
.edit-group, .settings-section { margin:0; padding:12px 16px; border-top:1px solid var(--edge); }
.edit-group summary { min-height:44px; padding-block:10px; color:var(--ink); }
.edit-group > label, .settings-section h2 { font-size:1.05em; }
.edit-group select { font-size:1rem; margin-top:8px; min-height:44px; }
.profile-choices, .cover-choices { display:grid; gap:8px; padding:4px 0 10px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.cover-choices { grid-template-columns:repeat(2,minmax(0,1fr)); }
.profile-choice, .cover-choice { position:relative; display:grid; justify-items:center; align-content:start; gap:6px; color:var(--ink); background:var(--paper); border:1px solid var(--edge); padding:9px 4px; min-width:0; font-size:.85em; overflow-wrap:anywhere; }
.profile-choice .avatar { width:42px; height:42px; }
.cover-choice { padding:5px; }
.cover-choice img { width:100%; aspect-ratio:2.6; object-fit:cover; border-radius:5px; }
.profile-choice[aria-pressed=true], .cover-choice[aria-pressed=true] { box-shadow:inset 0 0 0 2px var(--blue); }
.profile-choice[aria-pressed=true]::after, .cover-choice[aria-pressed=true]::after { content:"✓"; position:absolute; right:4px; top:4px; display:grid; place-items:center; width:19px; height:19px; border-radius:100%; background:var(--action-bg); color:var(--action-fg); font-size:12px; }
.settings-section { padding-block:17px; }
.settings-section:first-child { border-top:0; }
.settings-section h2 { margin-bottom:12px; }
.preference-group { min-width:0; margin:0 0 15px; padding:0; border:0; }
.preference-group:last-child { margin-bottom:0; }
.preference-group legend { margin-bottom:6px; padding:0; color:var(--muted); font-size:.9em; }
.preference-options { display:flex; flex-wrap:wrap; gap:6px; }
.preference-option { display:flex; align-items:center; gap:6px; min-height:44px; padding:6px 11px; font-weight:500; font-size:.92em; border:1px solid var(--edge); border-radius:10px; cursor:pointer; }
.preference-option:has(:checked) { color:var(--ink); background:var(--soft); border-color:var(--blue); }
.preference-option input { width:16px; height:16px; margin:0; accent-color:var(--blue); }
.settings-row { display:flex; min-height:46px; justify-content:space-between; align-items:center; gap:8px; text-decoration:none; color:var(--ink); }
.settings-row::after { content:"›"; color:var(--muted); font-size:22px; }
.settings-status { color:var(--muted); }
@media(max-width:700px) {
  html[data-surface="account"] body { background:var(--paper); }
  .account-head { padding-top:max(4px,env(safe-area-inset-top)); }
  .profile-summary { padding-inline:14px; }
  .profile-actions .account-outline { padding-inline:12px; font-size:.9em; }
  .account-page { padding-bottom:calc(72px + env(safe-area-inset-bottom)); }
}

.card-byline > .profile-link { position:absolute; left:14px; top:12px; display:grid; place-items:center; width:44px; height:44px; border-radius:50%; }
.card-byline > div { min-width:0; overflow-wrap:anywhere; }
.profile-name, .message-peer-link, html[data-scheme="dark"] :is(.profile-name,.message-peer-link) { color:var(--ink); text-decoration:none; font-weight:700; }
.profile-name:hover, .message-peer-link:hover { text-decoration:underline; }
.card-byline .profile-handle, .reply-byline .profile-handle { font-size:.83em; margin-inline-start:5px; overflow-wrap:anywhere; }
.reply-byline { flex-wrap:wrap; }
.message-head-handle { display:block; font-size:.7em; font-weight:500; color:var(--muted); }
.message-row-head .profile-handle { font-size:.8em; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.message-profile-link { display:grid; place-items:center; flex:none; width:44px; height:44px; }
.message-muse-row { border-inline-start:3px solid var(--blue); }
.message-ai-form { flex-wrap:wrap; gap:6px; }
.message-ai-input { flex:1 1 100%; width:100%; min-height:48px; resize:vertical; padding:10px 12px; border:1px solid var(--edge); border-radius:12px; color:var(--ink); background:var(--paper); font:inherit; }
.message-image-gallery { flex:1 1 100%; border:1px solid var(--edge); border-radius:12px; padding:8px 10px; background:var(--paper); }
.message-image-gallery summary { cursor:pointer; color:var(--link); font-weight:650; }
.message-image-selected { display:block; margin:6px 0; color:var(--muted); font-size:.84em; }
.message-image-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(82px,1fr)); gap:6px; }
.message-image-option { min-width:0; display:grid; gap:3px; padding:4px; border:1px solid var(--edge); border-radius:9px; background:var(--paper); color:var(--ink); font:inherit; font-size:.72em; cursor:pointer; }
.message-image-option img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:6px; }
.message-image-option.selected { outline:2px solid var(--blue); outline-offset:1px; }
.message-ai-auto-label, .message-ai-disclosure { display:inline-flex; align-items:center; gap:6px; min-height:44px; color:var(--muted); font-size:.88em; }
.message-image { display:block; max-width:min(240px,70vw); max-height:220px; margin-top:8px; border-radius:12px; object-fit:cover; }
.message-image[role="button"] { cursor:zoom-in; }
.message-ai-disclosure { flex-wrap:wrap; }
.messages-dialog .message-ai-form input[type="checkbox"] {
  width:18px; height:18px; min-height:0; flex:0 0 18px; margin:0;
}
.message-ai-cancel { min-height:34px; padding-inline:10px; }
.message-mode { display:block; margin-top:4px; font-size:.72em; opacity:.72; }
@media(max-width:700px) {
  .card-byline > .profile-link { top:10px; left:6px; }
  .card-byline > .profile-link .avatar { width:36px; height:36px; }
}
html[data-scheme="dark"] .nav-item, html[data-scheme="dark"] .tabs button { background:transparent; }
html[data-scheme="dark"] .nav-item:hover { background:var(--soft); }
html[data-surface="account"] .home-view-menu summary { font-weight:500; }
.mobile-nav .nav-item { color:var(--muted); text-decoration:none; }
.mobile-nav .nav-item[aria-current="page"], html[data-surface="timeline"] .mobile-nav .home-view-menu summary { color:var(--ink); font-weight:750; }
.mobile-nav .nav-item[aria-current="page"] .glyph, html[data-surface="timeline"] .mobile-nav .home-view-menu summary .glyph { stroke-width:2.5; }
@media(max-width:700px) {
  html[data-surface="account"] .stream-shell { margin-bottom:0; }
}
.card-byline a.profile-handle, .reply-byline a.profile-handle { color:var(--muted); text-decoration:none; }
.card-byline a.profile-handle:hover, .reply-byline a.profile-handle:hover { text-decoration:underline; }
html[data-scheme="dark"] .image-viewer { background:#000; }

.card-actions .original-links a, .profile-post .original-links a { color:var(--link); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.card.source-featured-card { padding:5px 8px; }
.source-featured-card > original-post-embed {
  width:min(100%,550px);
  margin-inline:auto;
  border-radius:12px;
  overflow:clip;
  background:var(--paper); color:var(--ink); color-scheme:inherit;
}
html[data-surface="timeline"][data-scheme="dark"] {
  --paper:#15202b;
  --soft:#1e2d3b;
  --edge:#38444d;
}
.source-featured-card iframe { color-scheme:inherit; }
.source-featured-card > original-post-embed .original-post-fallback {
  background:var(--paper);
  color:var(--muted);
}
.source-featured-card > original-post-embed .original-post-frame,
.source-featured-card > original-post-embed iframe { background:var(--paper); }
@media(max-width:700px) {
  .card.source-featured-card { padding:4px; }
}

/* /desktop.css */
/* Desktop-only X-like shell. The existing mobile shell remains the source of truth below 960px. */
.desktop-sidebar { display:none; }
.stream-title-actions { display:flex; align-items:center; gap:4px; }
.photos-inline { display:none; }
.desktop-compose-entry { display:none; }
.wordmark { display:inline-flex; align-items:center; gap:8px; }
.stream-title h1 { display:flex; align-items:center; gap:7px; }

@media (min-width:960px) {
  body { background:var(--soft); }
  /* X's three-column desktop canvas: a stable nav, readable feed, and a
     right rail that fills the remaining viewport instead of leaving a dark
     gutter beside the feed. */
  .stream-shell { grid-template-columns:minmax(220px,260px) minmax(0,600px) minmax(300px,1fr); gap:24px; max-width:1440px; padding:0 24px; }
  .rail { min-height:100dvh; padding:24px 4px; align-content:start; grid-auto-rows:max-content; }
  .rail .wordmark { font-size:31px; }
  .rail .wordmark .brand-face { width:34px; height:34px; }
  .rail .glyph { width:30px; height:30px; stroke-width:2.2; }
  .rail .nav-item { min-height:52px; font-size:17px; }
  .desktop-sidebar { position:sticky; top:0; display:grid; align-content:start; gap:18px; min-width:0; padding:20px 0; min-height:100dvh; }
  .desktop-search { display:grid; gap:2px; padding:8px 12px; border:1px solid var(--edge); border-radius:999px; background:var(--paper); }
  .desktop-search label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .desktop-search input { min-height:42px; padding:8px 10px; border:0; outline:0; background:transparent; }
  #desktop-search-status { min-height:17px; padding:0 10px 4px; color:var(--muted); font-size:11px; }
  .desktop-topics { padding:14px 16px; border:1px solid var(--edge); border-radius:16px; background:var(--paper); }
  .desktop-topics h2 { margin:0 0 10px; font-size:20px; }
  #desktop-topic-list { display:grid; gap:2px; }
  .desktop-topic { display:flex; justify-content:space-between; align-items:center; width:100%; min-height:44px; padding:8px 4px; border:0; border-radius:8px; background:transparent; color:var(--ink); text-align:left; }
  .desktop-topic:hover:not(:disabled), .desktop-topic:focus-visible { background:var(--soft); }
  .desktop-topic small { color:var(--muted); }
  .desktop-viral-title { margin:16px 0 4px; color:var(--muted); font-size:12px; }
  .desktop-viral { display:grid; grid-template-columns:1fr; gap:2px; padding:9px 4px; border-top:1px solid var(--edge); color:var(--ink); text-decoration:none; }
  .desktop-viral .viral-action { color:var(--link); }
  .desktop-compose-entry { display:flex; align-items:center; gap:10px; padding:10px 16px 12px; border-top:1px solid var(--edge); color:var(--muted); font-size:12px; }
  .desktop-compose-button { min-height:40px; padding-inline:18px; border:0; border-radius:999px; background:var(--action-bg); color:var(--action-fg); font-weight:800; }
  .desktop-compose-button:hover { filter:brightness(.95); }
  .timeline { border-inline:1px solid var(--edge); }
  .desktop-sidebar { border-left:1px solid var(--edge); padding-left:20px; }
  .stream-head { border-inline:1px solid var(--edge); }
  .timeline { min-height:100dvh; display:flex; flex-direction:column; }
  .timeline > #refresh-row { order:4; }
  .timeline > #feed { order:5; }
  .timeline > #more-row { order:6; }
  .timeline > .stream-head { order:1; }
  .timeline > #browse-filters { order:2; }
  .timeline > #timeline-note { order:3; }
  .desktop-nav-dot { display:inline-grid; place-items:center; width:23px; font-size:25px; line-height:1; }
  html[data-scheme="dark"] body,
  html[data-scheme="dark"] .stream-shell,
  html[data-scheme="dark"] .timeline,
  html[data-scheme="dark"] .stream-head,
  html[data-scheme="dark"] .rail,
  html[data-scheme="dark"] .card { background:var(--paper); }
  html[data-scheme="dark"] .timeline,
  html[data-scheme="dark"] .stream-head,
  html[data-scheme="dark"] .desktop-sidebar { border-color:var(--edge); }
  html[data-scheme="dark"] .desktop-search, html[data-scheme="dark"] .desktop-topics { box-shadow:0 1px 0 #ffffff08; }
}

@media (max-width:959px) {
  .desktop-sidebar, .desktop-nav-dot { display:none; }
}

.mobile-account-button,.mobile-account-button[hidden],.rail-identity { display:none; }
@media (min-width:960px) {
  html[data-scheme="dark"] { --paper:#000; --soft:#141619; --edge:#2f3336; --ink:#ecedef; --muted:#989fa5; --link:#66b9f0; --blue:#1d9bf0; }
  html[data-scheme="dark"] .stream-shell { background:var(--paper); }
  .rail { align-self:start; height:100dvh; display:flex; flex-direction:column; align-items:flex-start; gap:3px; overflow:auto; }
  .rail .nav-item, .rail .wordmark { flex:none; }
  .rail .nav-item { padding-inline:14px; border-radius:999px; }
  .rail .rail-post { border:0; border-radius:999px; width:92%; padding-block:13px; margin-top:12px; background:var(--ink); color:var(--paper); }
  .rail .rail-identity { margin-top:auto; display:flex; align-items:center; gap:10px; text-decoration:none; color:inherit; font-weight:700; padding:8px; }
  .rail .admin-link { margin:8px 12px; }
  .desktop-compose-entry { order:2; border-bottom:1px solid var(--edge); border-top:0; min-height:98px; gap:12px; }
  .desktop-compose-entry .avatar,.rail-identity .avatar { width:40px; height:40px; }
  .desktop-compose-entry .compose-prompt { text-align:left; font-size:19px; font-weight:450; padding:6px; flex:1; min-width:0; background:none; color:var(--muted); border:0; }
  .desktop-compose-entry .desktop-compose-button { background:var(--ink); color:var(--paper); }
  .desktop-sidebar { border:0; }
  .desktop-search { padding:2px 8px; }
  #desktop-search-status:empty { display:none; }
  .desktop-viral small { color:var(--link); }
  html[data-surface="account"] .desktop-topics,html[data-surface="account"] .desktop-search { display:none; }
}
@media (max-width:700px) {
  .stream-title { display:flex; gap:5px; align-items:center; min-height:56px; padding-inline:10px; }
  .mobile-account-button { display:flex; align-items:center; justify-content:center; min-width:38px; min-height:44px; text-decoration:none; }
  .mobile-account-button .avatar { width:30px; height:30px; }
  .stream-title h1 { font-size:17px; }
  .stream-title h1 .brand-face { width:27px; height:27px; }
  .stream-title-actions { margin-left:auto; gap:0; }
  .stream-title .glyph { width:18px; height:18px; }
  #filter-toggle { padding:4px; min-width:36px; min-height:44px; }
  .tabs { touch-action:pan-y pinch-zoom; }
  .card { padding-left:56px; }
}

@media (max-width:360px) {
  .stream-title h1 { font-size:14px; }
  .mobile-account-button { min-width:32px; }
  .stream-title { gap:2px; padding-inline:5px; }
}

/* Keep the page gutters and the embedded X cards on the same canvas. */
@media (min-width:960px) {
  html[data-surface="timeline"] .stream-shell { grid-template-columns:minmax(220px,260px) minmax(0,600px) minmax(300px,1fr); justify-content:stretch; gap:24px; }
  html[data-scheme="dark"][data-surface="timeline"] { --paper:#15202b; --soft:#1e2d3b; --edge:#38444d; --ink:#e7e9ea; --muted:#8b98a5; --link:#1d9bf0; --blue:#1d9bf0; --action-bg:#1d9bf0; --action-fg:#fff; }
  html[data-scheme="dark"][data-surface="timeline"],
  html[data-scheme="dark"][data-surface="timeline"] :is(body,.stream-shell,.rail,.desktop-sidebar) { background:var(--paper); }
  html[data-scheme="dark"][data-surface="timeline"] .source-featured-card,
  html[data-scheme="dark"][data-surface="timeline"] .source-featured-card > original-post-embed { background:var(--paper); }
}

/* /view-switch.css */
.brand-face { display:inline-grid; place-items:center; flex:none; width:30px; height:30px; overflow:hidden; border-radius:50%; background:var(--photo-edge,var(--soft)); }
.brand-face img { display:block; width:100%; height:100%; object-fit:cover; }
.site-ca {
  display:flex; align-items:center; flex-wrap:wrap; gap:6px 9px; min-width:0;
  padding:6px 12px; border-top:1px solid var(--edge); border-bottom:1px solid var(--edge);
  background:color-mix(in srgb,var(--soft) 52%,transparent); color:var(--muted);
}
.site-ca-name { flex:none; color:var(--ink); font-size:.76rem; font-weight:700; }
.site-ca-value { min-width:0; color:var(--muted); font-size:.7rem; line-height:1.35; overflow-wrap:anywhere; user-select:all; }
.site-ca-copy { flex:none; min-height:28px; padding:2px 8px; border:1px solid var(--edge); border-radius:7px; background:var(--paper); color:var(--link); font:inherit; font-size:.72rem; font-weight:700; cursor:pointer; }
.site-ca-copy:focus-visible { outline:2px solid var(--link); outline-offset:2px; }
.site-ca-status { flex:none; color:var(--muted); font-size:.68rem; }
.site-ca-status:empty { display:none; }
.photos-content > .site-ca {
  order:-1; align-self:center; width:min(100%,570px); border:1px solid var(--edge);
  border-radius:10px; margin-bottom:8px;
}
.day-view .photos-content > .site-ca { width:min(calc(100% - 24px),570px); margin:8px auto 0; }
.home-view-menu { position:relative; z-index:3; }
.home-view-menu > summary { list-style:none; cursor:pointer; touch-action:manipulation; }
.home-view-menu > summary::-webkit-details-marker { display:none; }
/* Keep the disclosure next to the label, including in the stacked mobile bar. */
.home-view-menu > summary { position:relative; user-select:none; }
.home-view-menu > summary span::after {
  content:''; display:inline-block; vertical-align:.08em; width:6px; height:6px; margin-left:5px;
  border-top:1.6px solid currentColor; border-right:1.6px solid currentColor; transform:rotate(135deg);
}
.home-view-menu[open] > summary span::after { transform:rotate(-45deg); }
.home-view-title { display:block; padding:8px 12px 4px; font-size:.74rem; font-weight:600; color:var(--muted); }
.home-view-list {
  position:absolute; left:0; top:calc(100% + 4px); display:grid; gap:2px; width:174px;
  max-width:calc(100vw - 24px); padding:5px; border:1px solid var(--edge); border-radius:14px;
  background:var(--paper); color:var(--ink); box-shadow:0 6px 25px rgb(0 0 0 / .18);
}
.home-view-list a {
  display:flex; align-items:center; justify-content:flex-start; gap:10px; min-height:46px; padding:0 12px;
  border-radius:9px; color:inherit; text-decoration:none; font-size:.9rem; font-weight:600;
}
.home-view-list a[aria-current=page]::after {
  content:''; width:6px; height:11px; margin-left:auto; border:solid currentColor; border-width:0 2px 2px 0;
  transform:translateY(-2px) rotate(45deg);
}
.home-view-list a:hover, .home-view-list a[aria-current=page] { background:color-mix(in srgb,currentColor 9%,transparent); }
.site-links-menu[open] { z-index:6; }
:is(.rail,.mobile-nav,.photos-side):has([data-site-links][open]) { z-index:10; }
.site-links-menu > summary { color:var(--link); }
.site-links-menu > summary svg { padding:4px; box-sizing:content-box; border-radius:8px; background:var(--soft); }
.site-links-menu .content-links-panel {
  width:min(336px,calc(100vw - 24px)); padding:9px; gap:8px;
  max-height:calc(100dvh - 86px); overflow:auto; overscroll-behavior:contain;
}
.content-links-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.content-links-grid a { display:grid; gap:0; min-width:0; padding:4px; }
.content-link-thumb { aspect-ratio:16/9; overflow:hidden; border-radius:6px; background:var(--soft); }
.content-link-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.content-link-name { padding:7px 2px 2px; display:flex; justify-content:space-between; gap:4px; }
.content-link-name span { color:var(--link); }
.content-token { display:grid; gap:5px; min-width:0; border-top:1px solid var(--edge); padding:6px 4px 2px; }
.content-token-header { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.content-token-header button { min-height:36px; padding:0 10px; color:var(--link); background:var(--soft); border:0; border-radius:8px; font-weight:600; }
.content-token-header button:focus-visible { outline:2px solid var(--link); outline-offset:2px; }
.content-token code { font-size:.7rem; color:var(--muted); overflow-wrap:anywhere; user-select:all; }
.content-token-status { font-size:.76rem; color:var(--muted); }
.content-token-status:empty { display:none; }
.home-view-menu :is(a,summary):focus-visible { outline:2px solid var(--link); outline-offset:-2px; }
.home-view-menu > summary { white-space:nowrap; }
.home-view-current { display:inline-flex; align-items:center; gap:4px; }
.home-view-link-icon { display:inline-grid; place-items:center; flex:0 0 20px; width:20px; color:var(--muted); font-size:1rem; }
.home-view-list a[aria-current=page] .home-view-link-icon { color:var(--link); }
@media (min-width:701px) {
  .photos-home-menu .home-view-list { left:calc(100% + 6px); top:0; }
  .site-links-menu .content-links-panel {
    position:fixed; left:var(--content-panel-left,12px); top:var(--content-panel-top,12px);
    max-height:calc(100dvh - 24px);
  }
  .photos-side { z-index:4; }
}
@media (max-width:700px) {
  .photos-content > .site-ca { width:calc(100% - 24px); margin:6px auto 0; }
  .site-ca { gap:3px 6px; padding:5px 10px; }
  .site-ca-value { flex:1 1 150px; font-size:.62rem; }
  .site-ca-copy { min-height:26px; padding-inline:7px; font-size:.68rem; }
  .site-ca-status { width:100%; font-size:.64rem; }
  .mobile-nav > :is(a,details) { flex:1; min-width:0; }
  .mobile-nav > details > summary { width:100%; }
  .mobile-nav .site-links-menu > summary svg { padding:3px; box-sizing:border-box; }
  :is(.mobile-nav,.photos-side-links) > .home-view-menu { position:static; }
  :is(.mobile-nav,.photos-side-links) .home-view-list {
    left:8px; top:auto; bottom:calc(100% + 6px);
    max-height:calc(100svh - var(--bottom-nav-height,80px) - 18px); overflow:auto;
  }
  :is(.mobile-nav,.photos-side-links) .site-links-menu .home-view-list { right:8px; left:auto; }
  .home-view-menu > summary span {
    display:inline-flex; align-items:center; padding:2px 7px; border-radius:99px;
    background:color-mix(in srgb,var(--ink) 9%,var(--paper)); color:var(--ink);
    font-size:11px; font-weight:700; line-height:1.25;
    max-width:100%; box-sizing:border-box; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .home-view-menu > summary span::after { transform:rotate(-45deg) translateY(1px); }
  .home-view-menu[open] > summary span::after { transform:rotate(135deg) translateY(1px); }
  .site-links-menu > summary span { color:var(--link); padding-inline:3px; font-size:10px; }
  .site-links-menu > summary span::after { width:4px; height:4px; margin-left:4px; }
}

/* /profile-layout.css */
/* Profile surfaces follow the compact X header and the Instagram media grid. */
.account-page {
  min-height:100%;
  overflow-x:clip;
}
.profile-empty { display:grid; justify-items:center; gap:10px; padding:42px 18px 56px; color:var(--muted); text-align:center; }
.profile-photo-count { color:var(--muted); font-weight:500; }
.profile-empty .empty { margin:0; }
.profile-guest-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.account-page .profile-cover,
.account-page .profile-summary,
.account-page .profile-tabs,
.account-page .profile-posts,
.account-page .account-empty,
.account-page .profile-guest,
.account-page .profile-form {
  width:min(100%, 640px);
  margin-inline:auto;
}
.account-page .profile-tabs {
  position:sticky;
  top:54px;
  z-index:1;
  background:var(--paper);
}
.profile-tabs .profile-tab {
  position:relative;
  min-height:48px;
  flex:1;
  color:var(--muted);
  border:0;
  border-radius:0;
  background:transparent;
  font-weight:650;
}
.profile-tabs .profile-tab[aria-selected="true"] {
  color:var(--ink);
  font-weight:800;
}
.profile-tabs .profile-tab[aria-selected="true"]::after {
  content:"";
  position:absolute;
  right:24%;
  bottom:-1px;
  left:24%;
  height:3px;
  border-radius:3px 3px 0 0;
  background:var(--blue);
}
.profile-media {
  grid-template-columns:repeat(3,minmax(0,1fr));
  background:var(--paper);
}
.profile-media .profile-tile-link {
  background:var(--paper);
}
.profile-media .profile-tile-link:focus-visible {
  position:relative;
  z-index:1;
  outline-offset:-3px;
}
.profile-photo-origin .profile-cover {
  display:none;
}
.profile-photo-origin .profile-summary {
  display:grid;
  grid-template-columns:64px minmax(0,1fr);
  column-gap:14px;
  align-items:start;
  padding-block:18px 10px;
}
.profile-photo-origin .profile-topline { display:contents; }
.profile-photo-origin .profile-topline > .avatar {
  grid-column:1;
  grid-row:1 / 4;
  width:64px;
  margin:0;
  border-width:1px;
}
.profile-photo-origin .profile-summary > :not(.profile-topline) { grid-column:2; }
.profile-photo-origin .profile-actions { grid-column:1 / -1; grid-row:6; margin-top:2px; }
.profile-photo-origin .profile-identity {
  grid-row:1;
  margin:0;
}
.profile-photo-origin .profile-identity h2 {
  font-size:1.1rem;
}
.profile-photo-origin .profile-bio,
.profile-photo-origin .profile-count,
.profile-photo-origin .profile-kind {
  font-size:.82rem;
}
@media (min-width:701px) {
  .account-page .profile-cover { border-radius:0; }
  .account-page .profile-summary { padding-inline:22px; }
  .account-page .profile-posts { border-inline:1px solid var(--edge); }
  .account-page .profile-tabs { border-inline:1px solid var(--edge); }
}
@media (max-width:700px) {
  .profile-empty { padding-block:34px 46px; }
  .account-page .profile-tabs { top:calc(54px + env(safe-area-inset-top)); }
  .profile-tabs .profile-tab[aria-selected="true"]::after { right:18%; left:18%; }
}

.account-page .profile-guest { display:grid; justify-items:center; gap:10px; padding:clamp(40px,9vh,76px) 20px; text-align:center; }
.profile-guest > .avatar { width:64px; height:64px; }
.profile-guest h2,.profile-guest p { margin:0; }
.profile-guest p { max-width:26em; color:var(--muted); line-height:1.65; }
.profile-guest .profile-actions { margin-top:8px; }
.profile-topline > img.avatar,.profile-post > img.avatar { object-fit:cover; }
.profile-summary .profile-identity { min-width:0; overflow-wrap:anywhere; }
.profile-actions { flex-wrap:wrap; }
.profile-summary .profile-count { font-variant-numeric:tabular-nums; }

/* /chat-launcher.css */
#shineni-chat-launcher {
  position:fixed; z-index:8; inset:auto max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) auto;
  display:flex; align-items:center; gap:9px; padding:4px 14px 4px 4px;
  border:1px solid var(--edge); border-radius:999px; background:var(--paper); color:var(--ink);
  font:inherit; font-size:14px; font-weight:700; line-height:1.3; cursor:pointer;
  box-shadow:0 3px 16px #0003; touch-action:manipulation;
}
#shineni-chat-launcher:focus-visible { outline:3px solid var(--link); outline-offset:3px; }
#shineni-chat-launcher:disabled { cursor:progress; }
.chat-launcher-face {
  position:relative; display:grid; place-items:center; flex:none; width:44px; height:44px;
  overflow:hidden; border-radius:50%; background:var(--soft); color:var(--ink);
}
.chat-launcher-face img {
  position:absolute; width:245%; height:auto; max-width:none; top:-26%; left:-103%; pointer-events:none;
}
.chat-launcher-bubble { display:none; }
.chat-launcher-notice {
  position:fixed; z-index:9; right:16px; bottom:90px; max-width:calc(100% - 32px);
  margin:0; padding:10px 14px; border:1px solid var(--edge); border-radius:12px;
  background:var(--paper); color:var(--ink); box-shadow:0 2px 12px #0002;
}
html:has(dialog[open]) #shineni-chat-launcher { visibility:hidden; }
@media(max-width:700px) {
  #shineni-chat-launcher {
    right:max(12px,env(safe-area-inset-right)); bottom:calc(68px + env(safe-area-inset-bottom));
    padding:2px; min-width:48px; min-height:48px;
  }
  .chat-launcher-label { display:none; }
  .chat-launcher-bubble {
    position:absolute; right:-1px; bottom:0; display:grid; place-content:center;
    width:21px; height:16px; padding-bottom:4px; border:1px solid var(--paper);
    border-radius:9px 9px 9px 2px; background:var(--ink); color:var(--paper);
    font-size:16px; font-weight:800; letter-spacing:0; line-height:1;
  }
  .chat-launcher-notice { bottom:calc(130px + env(safe-area-inset-bottom)); }
}

.chat-launcher-face img.chat-brand-crop { inset:0; width:100%; height:100%; object-fit:cover; }
.chat-launcher-face .blank-avatar { width:100%; height:100%; }
.dm-message-toast {
  position:fixed;
  z-index:30;
  top:max(10px, env(safe-area-inset-top));
  inset-inline:0;
  display:flex;
  align-items:center;
  gap:10px;
  width:min(340px,calc(100% - 22px));
  min-height:58px;
  margin-inline:auto;
  padding:8px 12px;
  border:1px solid var(--edge);
  border-radius:15px;
  background:var(--paper);
  color:var(--ink);
  box-shadow:0 6px 24px #0818272b;
  text-align:left;
  font:inherit;
  animation:dm-notice-pop 4.2s both;
}
.dm-message-toast img { flex:none; width:36px; height:36px; border-radius:50%; object-fit:cover; }
.dm-message-toast span { min-width:0; overflow-wrap:anywhere; }
.dm-message-toast strong,.dm-message-toast span span { display:block; font-size:13px; line-height:1.35; }
.dm-message-toast span span { color:var(--muted); }
button.dm-message-toast { cursor:pointer; }
.messages-dialog .dm-message-toast { position:absolute; z-index:8; pointer-events:none; }
@keyframes dm-notice-pop {
  from { opacity:0; transform:translateY(-110%); }
  8% { opacity:1; transform:translateY(3px); }
  12%,91% { opacity:1; transform:translateY(0); }
  to { opacity:0; transform:translateY(-14px); }
}
@media(prefers-reduced-motion:reduce) { .dm-message-toast { animation:none; } }

@media (max-width:700px) {
  html[data-surface="timeline"] #shineni-chat-launcher { display:none; }
}

