:root {
  --screen: 420px;
  --bar-height: 46px;
  --ink: #454545;
  --dim: #686868;
  --rule: #dedede;
  color-scheme: light;
  font-family: "Avenir Next Condensed", "Arial Narrow", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #e7e6e4;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; text-underline-offset: .25em; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #0f529b; outline-offset: -3px; }
[hidden], .hidden { display: none !important; }
.sr-only, .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.wrap, .sheet {
  width: min(100%, var(--screen)); min-height: 100vh; min-height: 100dvh; margin-inline: auto; background: #f3f3f3;
}
.topbar, .dialoghead {
  position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: var(--bar-height) minmax(0,1fr) var(--bar-height);
  min-height: calc(var(--bar-height) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
  color: #383838; background: linear-gradient(#fafafaed, #e9e8e6ed);
  backdrop-filter: blur(14px); box-shadow: inset 0 -1px #0002;
}
.brand, .dialoghead h2 {
  align-self: center; justify-self: center; grid-column: 2; grid-row: 1; margin: 0; text-align: center; text-decoration: none;
}
.brand { font: 550 25px/1 "Avenir Next Condensed", "Arial Narrow", sans-serif; letter-spacing: -.035em; transform: scaleX(.88); }
.nav-action, .close { display: grid; place-items: center; width: var(--bar-height); height: var(--bar-height); }
.nav-action svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-action:hover, .close:hover { background: #00000008; }
.dialoghead h2 { max-width: 100%; font-size: 17px; font-weight: 550; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.close { grid-column: 1; grid-row: 1; font: bold 27px/1 Arial,sans-serif; }
.feed { display: flex; flex-direction: column; }
.theme0 { --surface: linear-gradient(168deg,#cd3d42,#c6353c); }
.theme1 { --surface: radial-gradient(ellipse at 58% 50%,#458fbe,#4587ba 85%); }
.theme2 { --surface: linear-gradient(158deg,#148f89,#16867f); }
.theme3 { --surface: repeating-linear-gradient(90deg,transparent 0 3px,#eff1ff05 3px 4px),linear-gradient(140deg,#55537e,#4b4c79); }
.theme4 { --surface: linear-gradient(125deg,#c57920,#be6c17); }
.theme5 { --surface: #fff; --card-ink: #393939; --card-subtle: #666; }
.card, .compose-canvas {
  position: relative; isolation: isolate; display: grid; place-items: center; width: 100%; aspect-ratio: 1;
  color: var(--card-ink,#fff); background: var(--surface,#4689bb); overflow: hidden;
}
.feed .card + .card { border-top: 2px solid #0000000d; }
.cardtext, .compose-canvas textarea {
  font-size: clamp(20px,5.6vw,25px); font-weight: 500; line-height: 1.48; text-align: center; letter-spacing: -.028em;
  overflow-wrap: anywhere; white-space: pre-wrap;
}
.cardopen {
  position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%;
  padding: 44px 21px; color: inherit;
}
.cardtext { margin: 0; min-width: 0; max-width: 100%; }
.cardopen .cardtext { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.cardopen:focus-visible, .card-action:focus-visible { outline-color: currentColor; }
.cardfoot {
  position: absolute; bottom: 0; inset-inline: 0; display: flex; align-items: center; justify-content: space-between;
  padding-inline: 14px 8px; min-height: 43px; pointer-events: none; color: var(--card-subtle,#fff);
}
.relation, .samplehint { font-size: 12px; line-height: 1.2; font-weight: 500; }
.cardactions { display: inline-flex; align-items: center; pointer-events: auto; }
.card-action { display: inline-flex; align-items: center; justify-content: center; min-width: 39px; min-height: 43px; padding: 0 5px; gap: 4px; color: inherit; font-size: 13px; }
.card-action svg { width: 18px; height: 18px; flex: none; }
.card-action[aria-pressed=true] svg { fill: currentColor; filter: drop-shadow(0 0 2px currentColor); }
.card-action[aria-pressed=true] { background: #0002; }
.samplehint { margin-right: 7px; }
.modal { position: fixed; inset: 0; z-index: 10; padding: 0; overflow: hidden; background: #29292924; }
.sheet { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
#panel { padding: 16px; }
.modal[data-mode=thread] #panel, .modal[data-mode=compose] #panel, .modal[data-mode=menu] #panel { padding: 0; }
.sheet h3 { margin: 18px 0 9px; font-size: 16px; }
.sheet label { display: block; margin: 9px 0; font-size: 14px; }
textarea, input:not([type=hidden]), select {
  display: block; width: 100%; padding: 11px; margin: 7px 0; color: #333; background: #fff; border: 1px solid #bbb;
  border-radius: 3px; font-size: 16px; line-height: 1.4;
}
textarea { resize: vertical; }
.primary, .secondary, .publish, #reply button[type=submit], #reply > button:last-child {
  padding: 9px 16px; min-height: 42px; background: #555; color: white; font-size: 14px; font-weight: 600; border-radius: 2px;
}
.secondary { color: #444; background: #e3e3e3; }
.primary:hover, .publish:hover { background: #414141; }
.actions, .tools, .linkrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block: 10px; }
.note, .muted, .audience { color: var(--dim); line-height: 1.6; font-size: 14px; }
.error { margin: 12px 16px; color: #a32433; font-size: 14px; line-height: 1.5; }
.empty { padding: 24px 18px; text-align: center; line-height: 1.6; }
.empty h2, .empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 6px 0 14px; font-size: 14px; color: var(--dim); }
.compose-canvas textarea {
  margin: 0; padding: 8px 22px; align-content: center; height: calc(100% - 100px); resize: none;
  color: inherit; background: transparent; border: 0; border-radius: 0;
}
.compose-canvas textarea:focus-visible { outline: none; }
.compose-canvas:focus-within { box-shadow: inset 0 0 0 2px currentColor; }
.compose-canvas textarea::placeholder { color: inherit; opacity: .96; }
.theme-label { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); max-width: 85%; background: #ffffff2d; padding: 5px 9px; font-size: 12px; }
.theme5 .theme-label { background: #eee; }
.compose-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 3px; }
.swatch { display: grid; place-items: center; width: 30px; height: 42px; }
.swatch::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--surface,#555); border: 1px solid #0002; }
.swatch[aria-pressed=true]::before { outline: 2px solid #494949; outline-offset: 2px; }
.audience { margin: 16px; text-align: center; }
.card.detail { min-height: auto; height: auto; }
.detail .cardtext { padding: 52px 21px; }
#comments { background: white; }
.comment { display: flex; align-items: flex-start; min-height: 60px; gap: 10px; padding: 12px 10px; border-bottom: 1px solid var(--rule); }
.aliasglyph { display: grid; place-items: center; width: 27px; height: 27px; flex: none; font-size: 19px; }
.comment-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.comment-body strong { font-size: 12px; font-weight: 650; }
.comment-body p { margin: 3px 0; line-height: 1.5; font-size: 15px; white-space: pre-wrap; }
.comment-body small { color: var(--dim); font-size: 11px; }
.comment-more { min-width: 35px; min-height: 35px; color: #666; }
#comments > .muted { margin: 0; padding: 14px 16px; }
#reply { display: flex; gap: 6px; align-items: center; padding: 6px 10px max(8px,env(safe-area-inset-bottom)); background: #eee; }
#reply textarea { flex: 1; min-width: 0; margin: 0; min-height: 40px; max-height: 100px; }
.menu-group { margin: 0 0 14px; background: white; }
.menu-row, .listbtn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--rule); background: white; }
.menu-row:hover, .listbtn:hover { background: #ededed; }
.menu-row[aria-current=true], .menu-row[aria-pressed=true] { background: #e8f2f6; font-weight: 650; }
.toast { position: fixed; bottom: max(20px,env(safe-area-inset-bottom)); left: 50%; z-index: 20; transform: translateX(-50%); max-width: 85vw; width: max-content; padding: 9px 16px; border-radius: 3px; color: #fff; background: #333e; font-size: 14px; }
@media(min-width: 421px) { .wrap, .sheet { box-shadow: 0 0 0 1px #0000000c; } }
/* Paper grain, woven mesh and narrow wood grain remain independent of the base color. */
.texture1::before, .texture2::before, .texture3::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
}
.texture1::before {
  background: radial-gradient(ellipse 68% 58% at 16% 28%,#ffffff15,transparent),
    radial-gradient(ellipse 50% 65% at 72% 68%,#00000013,transparent),
    repeating-linear-gradient(23deg,transparent 0 2px,#00000004 3px 4px);
}
.texture2::before {
  background: repeating-linear-gradient(45deg,#00000012 0 1px,transparent 1px 3px),
    repeating-linear-gradient(-45deg,#ffffff13 0 1px,transparent 1px 4px);
}
.texture3::before {
  background: repeating-linear-gradient(90deg,transparent 0 5px,#00000007 6px 8px,transparent 9px 28px,#ffffff0c 30px 32px),
    repeating-radial-gradient(ellipse 7% 120% at 75% 96%,transparent 0 8px,#0000000a 9px 10px,transparent 12px 18px);
}
.has-photo { --card-ink: white; --card-subtle: white; color: white; background-size: cover; background-position: center; }
.has-photo .cardtext, .has-photo .cardfoot, .has-photo textarea, .has-photo .theme-label { text-shadow: 0 1px 4px #000b; }
.has-photo .theme-label { background: #0006; }
.has-photo::before { display: none; }
.photo-pick, .sheet label.photo-pick {
  position: absolute; bottom: 0; left: 0; display: grid; place-items: center; width: 46px; height: 46px; margin: 0; cursor: pointer;
}
.photo-pick:focus-within { outline: 2px solid currentColor; outline-offset: -3px; }
.photo-pick svg { width: 24px; height: 24px; }
.texture-button { min-height: 42px; padding: 0 7px; color: #444; border-bottom: 1px solid #aaa; font-size: 13px; }
.compose-toolbar { flex-wrap: wrap; }
.compose-toolbar .publish { margin-left: auto; }
.gesture-note { margin: 0 12px; color: var(--dim); text-align: center; font-size: 13px; }
.aliasglyph { border-radius: 50%; background: #f1edf1; }
@media(prefers-reduced-motion:no-preference) {
  .modal[data-mode=thread] .sheet { animation: reveal-thread .16s ease-out; }
  @keyframes reveal-thread { from { transform: translateY(12px); opacity: .9; } to { transform: translateY(0); opacity: 1; } }
}
.modal:is([data-mode=thread],[data-mode=compose]) .dialoghead h2 {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.modal[data-mode=compose] .publish {
  position: fixed; z-index: 4; top: env(safe-area-inset-top); right: max(0px, calc((100vw - var(--screen)) / 2));
  min-height: var(--bar-height); padding-inline: 15px; color: #333; background: transparent; font-weight: 550;
}
.modal[data-mode=thread] .dialoghead {
  position: absolute; width: min(100%,var(--screen)); min-height: 0; background: none; box-shadow: none; backdrop-filter: none; pointer-events: none;
}
.modal[data-mode=thread] .close {
  color: #fff; background: #0004; text-shadow: 0 1px 3px #0008; pointer-events: auto;
}
.photo-pick input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.menu-group h3 { margin: 0; padding: 12px 16px 5px; font-size: 12px; color: var(--dim); background: #f3f3f3; }
.empty .actions { justify-content: center; }
.aliasglyph { color: hsl(var(--alias-hue,210) 55% 37%); background: hsl(var(--alias-hue,210) 52% 93%); }

#compose { min-height: calc(100dvh - var(--bar-height) - env(safe-area-inset-top)); display: flex; flex-direction: column; }
#compose .compose-canvas { flex-shrink: 0; }
.appearance-controls { padding: 5px 16px; color: var(--dim); font-size: 13px; }
.appearance-controls summary, details.audience summary { cursor: pointer; width: fit-content; padding: 8px 0; }
details.audience { margin: auto auto 6px; padding: 10px 16px; }
details.audience summary { margin-inline: auto; }
details.audience p { margin: 0 0 5px; }
.relation-help { color: inherit; font: inherit; pointer-events: auto; padding: 5px 0; }

#room-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 15px; background:#f8f7f5; border-bottom:1px solid #d4d4d2; }
#room-bar small, #room-bar strong { display:block; }
#room-bar small { color:#666; font-size:11px; }
#room-bar strong { line-height:1.45; overflow-wrap:anywhere; }
.room-link { color:#315d76; white-space:nowrap; min-height:40px; }
.start-room { display:flex; width:100%; justify-content:space-between; align-items:center; font-size:14px; min-height:28px; }
.start-room span:last-child { font-size:19px; }
.room-empty { text-align:center; padding:52px 12px; color:#626262; }
.room-empty p { margin:0 0 7px; font-size:20px; }
.wrap:has(#room-message:not([hidden])) { padding-bottom:calc(77px + env(safe-area-inset-bottom)); }
#room-message { position:fixed; bottom:0; left:50%; transform:translateX(-50%); width:min(100%,var(--screen)); display:flex; align-items:center; gap:8px; z-index:2; padding:8px 10px calc(8px + env(safe-area-inset-bottom)); background:#efefef; border-top:1px solid #ccc; }
#room-message textarea { flex:1; resize:none; margin:0; max-height:110px; }
#room-message button { flex:none; }
.modal[data-mode=join] #panel:has(.invite-cover) { padding:0; }
.invite-cover { background:linear-gradient(160deg,#4287ae,#346988); color:white; min-height:190px; display:flex; flex-direction:column; justify-content:center; align-items:center; padding:28px; text-align:center; }
.invite-cover span { font-size:13px; }
.invite-cover h3 { font-size:28px; font-weight:500; margin:9px 0; overflow-wrap:anywhere; }
.accept-room { padding:10px 22px 20px; }
.accept-room p { line-height:1.65; }
.accept-room .primary { width:100%; }
.accept-room small { display:block; margin-top:16px; line-height:1.6; color:#666; }
.report-item { padding:12px 0; border-bottom:1px solid #ccc; }
.report-item p { white-space:pre-wrap; overflow-wrap:anywhere; }
#room-bar:has(.room-bar-actions) { position:sticky; top:calc(var(--bar-height) + env(safe-area-inset-top)); z-index:2; }
.room-bar-actions { display:flex; gap:9px; align-items:center; flex:none; }
.room-bar-actions .room-link { font-size:13px; }
.room-bar-actions [data-act=layout] { color:#777; }
.chat-stream { display:flex; flex-direction:column; padding:8px 14px; }
.chat-line { align-self:flex-start; max-width:88%; margin-top:12px; }
.chat-line.mine { align-self:flex-end; }
.chat-meta, .chat-tools { display:flex; align-items:center; gap:6px; }
.chat-meta { color:#666; font-size:12px; }
.chat-meta .aliasglyph { width:23px; height:23px; font-size:12px; }
.chat-meta time { font-size:10px; }
.mine .chat-meta,.mine .chat-tools { justify-content:flex-end; }
.chat-body { display:block; margin-top:5px; padding:10px 13px; text-align:start; line-height:1.55; color:#30383b; background:#fff; border:1px solid #dadad6; border-radius:3px 9px 9px; white-space:pre-wrap; overflow-wrap:anywhere; }
.mine .chat-body { margin-left:auto; background:#e1edf1; border-color:#c5d7dd; border-radius:9px 3px 9px 9px; }
.chat-photo { display:block; max-width:140px; max-height:140px; margin-bottom:5px; }
.chat-tools { color:#626262; }
.chat-tools button { display:flex; align-items:center; min-height:32px; min-width:32px; font-size:12px; }
.policy { padding:24px 22px 48px; line-height:1.7; overflow-wrap:anywhere; }
.policy h1 { margin:24px 0 12px; font-size:26px; }
.policy h2 { font-size:18px; margin:26px 0 4px; }
.policy p { margin:9px 0; }
.policy a { color:#335d74; }
.room-pages { display:flex; justify-content:center; gap:14px; }
.room-pages button { min-height:40px; color:#315d76; font-size:13px; }

#dialog-title:focus { outline:none; }
