@font-face {
  font-family: 'First Sight Serif';
  src: url('/media/display.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'First Sight Wordmark';
  src: url('/media/wordmark.woff2') format('woff2');
  font-display: swap;
}

:root {
  color-scheme: light;
  --canvas: hsl(12 43% 96%);
  --paper: hsl(15 48% 99%);
  --ink: hsl(344 32% 16%);
  --body: hsl(345 20% 31%);
  --muted: hsl(344 14% 40%);
  --line: hsl(5 27% 86%);
  --field: hsl(345 13% 48%);
  --soft: hsl(350 49% 92%);
  --tint: hsl(15 38% 97%);
  --brand: hsl(344 51% 34%);
  --brand-dark: hsl(343 48% 25%);
  --accent: hsl(354 63% 82%);
  --night: hsl(342 40% 17%);
  --night-hover: hsl(344 30% 26%);
  --radius: 10px;
  --radius-large: 16px;
  --shadow-low: 0 1px 2px hsl(344 36% 16% / 8%), 0 5px 14px hsl(344 36% 16% / 7%);
  --shadow: 0 10px 28px hsl(344 36% 16% / 14%);
  --shadow-inset: inset 0 2px 3px hsl(344 36% 16% / 6%), inset 0 -1px 0 white;
  --sidebar: 224px;
  --display: 'First Sight Serif', 'Songti TC', 'Noto Serif CJK TC', 'PMingLiU', serif;
  font-family: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
html, body, dialog, .thread-messages { touch-action: manipulation; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
input, textarea, select, button { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: inherit; text-decoration: none; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { display: inline-block; width: 22px; height: 22px; flex: none; vertical-align: middle; }
h1, h2, p { margin: 0; }
small { font-size: .8125rem; color: var(--muted); font-weight: 400; }
textarea { resize: vertical; }

.workspace { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 32px 20px 24px; }
.brand { display: inline-flex; align-items: center; gap: 7px; align-self: start; color: var(--ink); }
.brand img { width: 30px; height: 30px; flex: none; }
.brand span { display: block; font: 400 1.65rem/1 'First Sight Wordmark', Georgia, serif; white-space: nowrap; }
.sidebar nav { display: grid; gap: 4px; margin-top: 52px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: .94rem; font-weight: 600; }
.sidebar nav a:hover { background: var(--tint); color: var(--ink); }
.sidebar nav a[aria-current] { background: var(--soft); color: var(--brand-dark); font-weight: 750; }
.sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.workspace:not(.is-admin) .sidebar { background: var(--night); border-color: transparent; }
.workspace:not(.is-admin) .sidebar .brand { color: var(--paper); }
.workspace:not(.is-admin) .sidebar nav a, .workspace:not(.is-admin) .sidebar-foot .quiet-link { color: var(--accent); }
.workspace:not(.is-admin) .sidebar nav a:is(:hover, [aria-current]) { color: var(--paper); background: var(--night-hover); }
.workspace:not(.is-admin) .sidebar-foot { border-top-color: var(--night-hover); }
.workspace:not(.is-admin) .sidebar :focus-visible { outline-color: var(--accent); }
.quiet-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: none; border: 0; padding: 0; font-size: .875rem; }
.quiet-link:hover { color: var(--brand); }
.quiet-link svg { width: 18px; height: 18px; }
.topbar { min-height: 68px; padding: 10px max(32px, calc((100% - 1120px) / 2)); display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.top-title { font-size: 1.075rem; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.top-actions .front-link { display: none; }
.mobile-nav { display: none; }
.discover-search, .search-box { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--field); color: var(--muted); padding: 0 12px; border-radius: 8px; }
.discover-search input, .search-box input { width: 100%; min-width: 0; min-height: 44px; border: 0; background: none; font-size: .9375rem; color: var(--ink); outline: none; }
.discover-search:focus-within, .search-box:focus-within { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.discover-search svg, .search-box svg { width: 19px; height: 19px; }
.account { position: relative; z-index: 4; }
.account summary { min-height: 44px; list-style: none; display: flex; gap: 8px; padding: 3px 7px; align-items: center; border-radius: 12px; font-size: .875rem; font-weight: 700; }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { background: var(--soft); }
.account summary .avatar { width: 32px; height: 32px; }
.account summary svg { width: 17px; height: 17px; color: var(--brand); }
.account-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 138px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; }
.account-menu a, .account-menu button { display: block; width: 100%; border: 0; border-radius: 8px; background: none; text-align: left; padding: 10px 12px; font-size: .875rem; }
.account-menu a:hover, .account-menu button:hover { background: var(--tint); }
#content { width: min(100%, 1184px); margin: 0 auto; padding: 32px 32px 56px; outline: none; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--brand-dark); background: var(--soft); overflow-wrap: anywhere; }
.notice svg { width: 19px; height: 19px; margin-top: 2px; }
.mute-notice { align-items: center; flex-wrap: wrap; }
.mute-notice .quiet-link { min-height: 44px; margin-inline-start: auto; color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.thread .mute-notice { margin: 0; border-width: 1px 0 0; border-radius: 0; }

.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: 0 15px; font-weight: 700; font-size: .875rem; line-height: 1.2; white-space: nowrap; }
.button svg, .icon-button svg { width: 19px; height: 19px; }
.button.primary { background: var(--brand); color: var(--paper); box-shadow: inset 0 1px 0 hsl(344 42% 51%), 0 2px 4px hsl(344 45% 24% / 18%); }
.button.primary:hover { background: var(--brand-dark); }
.button.primary:active { box-shadow: inset 0 2px 3px hsl(344 50% 18% / 42%); }
.button.danger { color: white; background: hsl(347 62% 40%); }
.button.danger:hover { background: hsl(347 62% 33%); }
.button.quiet.danger-link { color: hsl(347 62% 38%); }
.button.secondary { background: var(--paper); border-color: var(--line); color: var(--brand-dark); }
.button.secondary:hover, .button.tinted:hover { background: var(--soft); }
.button.tinted { color: var(--brand); background: var(--tint); }
.button.quiet { color: var(--brand-dark); background: transparent; }
.button.quiet:hover { background: var(--soft); }
.button.compact { min-height: 36px; padding: 0 11px; }
.button.compact svg { width: 16px; height: 16px; }
.icon-button { padding: 0; width: 42px; height: 42px; color: var(--brand-dark); background: var(--tint); }
.icon-button:hover { background: var(--soft); }
.plain { padding: 0; border: 0; background: transparent; text-align: left; }
.count { display: inline-grid; place-items: center; min-width: 19px; min-height: 19px; padding: 0 4px; font-size: .75rem; line-height: 1; border-radius: 999px; background: var(--brand); color: white; }
.nav-count { margin-left: auto; }

.directory-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.directory-head h1 { color: var(--brand-dark); font: 700 clamp(2.25rem, 4.2vw, 3.5rem)/1.18 var(--display); letter-spacing: -.07rem; }
#discover-count { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; flex: none; }
.directory-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.discover-search { width: min(370px, 100%); }
.directory-controls .discover-search:not(:focus-within) { box-shadow: var(--shadow-inset); }
.top-search { width: min(250px, 24vw); }
.page-heading h1 { font: 700 clamp(1.75rem, 3vw, 2.3rem)/1.22 var(--display); letter-spacing: -.04rem; }
.page-heading p { color: var(--muted); margin-top: 6px; font-size: .94rem; }
.filters { display: flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); box-shadow: var(--shadow-inset); }
.filters button { min-width: 52px; min-height: 42px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; color: var(--body); background: transparent; font-size: .875rem; white-space: nowrap; }
.filters button:hover { color: var(--ink); background: var(--tint); }
.filters button[aria-pressed="true"] { border-color: var(--line); background: var(--paper); color: var(--brand-dark); font-weight: 700; box-shadow: 0 1px 3px hsl(344 36% 16% / 10%); }
.person-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; }
.person-card { position: relative; isolation: isolate; min-width: 0; padding: 4px 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-large); background: var(--paper); box-shadow: var(--shadow-low); }
.person-visual { position: relative; }
.person-photo { position: relative; width: 100%; aspect-ratio: 1.15; display: block; overflow: hidden; border: 0; border-radius: var(--radius); padding: 0; background: var(--soft); }
.person-photo::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px hsl(344 32% 13% / 20%), inset 0 1px 0 hsl(0 0% 100% / 18%); pointer-events: none; }
.person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.photo-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: var(--brand); font: 700 3.2rem var(--display); }
.sample-label { position: absolute; top: 9px; left: 9px; padding: 3px 6px; background: var(--paper); color: var(--body); font-size: .75rem; border-radius: 4px; pointer-events: none; }
.mutual-label { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 4px 8px; border-radius: 999px; background: var(--soft); color: var(--brand-dark); font-size: .75rem; font-weight: 700; }
.mutual-label svg { width: 14px; height: 14px; fill: currentColor; }
.person-visual > .mutual-label { position: absolute; inset: 8px auto auto 8px; pointer-events: none; }
.detail-identity > .mutual-label { margin-bottom: 8px; }
.person-info { padding: 4px 8px 0; }
.person-line { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.person-city { min-width: 0; }
.person-name { display: block; min-width: 0; max-width: 100%; font-weight: 750; font-size: 1.16rem; line-height: 1.4; }
.person-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-name::after { content: ''; position: absolute; z-index: 1; inset: 0; border-radius: var(--radius-large); }
.person-name:focus-visible { outline: none; }
.person-name:focus-visible::after { outline: 2px solid var(--brand); outline-offset: 3px; }
.person-name:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.person-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.person-card .person-meta:empty { display: none; }
.person-meta > span { white-space: nowrap; }
.presence-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.presence-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.presence-badge[data-presence="online"], .presence-badge[data-presence="pinned"] { color: hsl(149 52% 29%); }
.gender-age { display: inline-flex; flex: none; align-items: center; gap: 4px; white-space: nowrap; vertical-align: middle; }
.gender-icon { display: inline-grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; }
.gender-icon svg { width: 15px; height: 15px; stroke-width: 2; }
.gender-icon.f { background: hsl(341 49% 93%); color: hsl(337 45% 38%); }
.gender-icon.m { background: hsl(208 51% 93%); color: hsl(214 48% 37%); }
.person-city { overflow: hidden; text-overflow: ellipsis; }
.person-city svg { width: 13px; height: 13px; color: var(--brand); }
.person-city:not(:first-child) { padding-inline-start: 8px; border-inline-start: 1px solid var(--line); }
.like { position: absolute; z-index: 2; right: 8px; bottom: 8px; width: 44px; height: 44px; min-height: 44px; background: var(--paper); color: var(--brand); border-radius: 50%; box-shadow: 0 1px 2px hsl(344 36% 16% / 20%), 0 4px 10px hsl(344 36% 16% / 20%); }
.like.selected { background: var(--brand); color: var(--paper); }
.like.selected svg { fill: currentColor; }
.like:active { box-shadow: 0 1px 2px hsl(344 36% 16% / 20%); }
.like.selected:focus-visible { outline-color: var(--paper); }
.like:focus-visible { outline-offset: -4px; }
.button.greet { position: relative; z-index: 2; flex: none; min-height: 44px; border-color: var(--line); color: var(--brand-dark); padding-inline: 10px; background: var(--tint); }
.button.greet:is(:hover, :active) { background: var(--soft); border-color: var(--field); }
.person-bio { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--body); font-size: .875rem; }

.member-detail { max-width: 760px; margin-inline: auto; }
.member-detail > .back { min-height: 44px; margin-bottom: 8px; }
.member-detail article { border: 1px solid var(--line); border-radius: var(--radius-large); background: var(--paper); box-shadow: var(--shadow-low); }
.detail-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
.detail-portrait { display: block; width: 100%; aspect-ratio: 6 / 5; overflow: hidden; border-radius: var(--radius-large) 0 0 0; background: var(--soft); }
.detail-portrait:focus-visible { outline-offset: -4px; }
.detail-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 37%; }
.detail-portrait.placeholder { display: grid; place-items: center; align-self: stretch; min-height: 144px; aspect-ratio: auto; }
.detail-portrait.placeholder .avatar { background: var(--paper); }
.detail-identity { min-width: 0; padding: 24px; }
.detail-identity h1 { font: 700 2.25rem/1.2 var(--display); overflow-wrap: anywhere; }
.detail-meta, .detail-sample { font-size: .875rem; color: var(--muted); }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; overflow-wrap: anywhere; }
.detail-meta:empty { display: none; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.detail-actions .button { min-height: 44px; }
.detail-actions [aria-pressed="true"] svg { fill: currentColor; }
.detail-section { display: grid; gap: 8px; padding: 20px 24px; border-top: 1px solid var(--line); }
.detail-section h2 { font-weight: 700; font-size: 1rem; }
.detail-bio { color: var(--body); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-empty { color: var(--muted); font-size: .875rem; }
.detail-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.detail-gallery button { overflow: hidden; border-radius: var(--radius); background: var(--tint); }
.detail-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.narrow { max-width: 760px; margin-inline: auto; }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 22px; }
.empty { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 16px; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); text-align: center; }
.empty h2 { font-weight: 700; font-size: 1.14rem; }
.empty p { color: var(--muted); }
.empty .button { margin-top: 6px; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--soft); color: var(--brand); flex: none; }
.directory #people > .empty { gap: 12px; padding: 32px 20px; border-radius: var(--radius-large); background: linear-gradient(165deg, hsl(349 49% 96%), var(--paper) 65%); box-shadow: var(--shadow-low); }
.directory #people > .empty .empty-icon { width: 56px; height: 56px; border: 4px solid var(--paper); border-radius: 50%; box-shadow: var(--shadow-low); }
.directory #people > .empty .button { min-height: 44px; }
.loading { padding: 28px 0; color: var(--muted); text-align: center; }
.avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; object-fit: cover; object-position: center 37%; }
.initials { display: grid; place-items: center; color: var(--brand); background: var(--soft); font-weight: 700; }
.avatar.large { width: 96px; height: 96px; margin-inline: auto; font-size: 2rem; }
.post-list { display: grid; gap: 20px; }
.chat-list, .admin-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.post { padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.post header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-author { min-width: 0; overflow-wrap: anywhere; }
.post-actions { display: flex; flex: none; align-items: center; gap: 4px; margin-inline-start: auto; }
.safety-button { width: 44px; height: 44px; min-height: 44px; flex: none; }
.post p { margin-bottom: 12px; color: var(--body); overflow-wrap: anywhere; white-space: pre-wrap; }
.post-image { display: block; max-width: 100%; }
.post-image img { max-width: 100%; max-height: 430px; border-radius: 8px; }
.me-page { max-width: 512px; margin-inline: auto; }
.me-profile { position: relative; isolation: isolate; display: grid; justify-items: center; padding: 32px 16px 24px; border-radius: var(--radius-large); background: var(--paper); box-shadow: var(--shadow-low); text-align: center; }
.me-profile::before { content: ''; position: absolute; z-index: -1; inset: 0 0 auto; height: 96px; border-radius: var(--radius-large) var(--radius-large) 0 0; background: repeating-linear-gradient(125deg, hsl(0 0% 100% / 17%) 0 1px, transparent 1px 4px), linear-gradient(115deg, hsl(345 43% 82%), hsl(18 65% 89%)); }
.me-portrait { position: relative; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; }
.me-portrait .avatar { width: 96px; height: 96px; border: 4px solid var(--paper); box-shadow: var(--shadow-low); font-size: 1.875rem; }
.me-portrait .initials { background: var(--tint); }
.me-portrait .initials svg { width: 30px; height: 30px; }
.me-camera { position: absolute; inset: auto 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--paper); border-radius: 50%; background: var(--brand); color: var(--paper); }
.me-camera svg { width: 16px; height: 16px; }
.me-portrait:hover .me-camera { background: var(--brand-dark); }
.me-profile h1 { max-width: 100%; margin-top: 12px; font: 700 1.5rem/1.3 var(--display); overflow-wrap: anywhere; }
.me-profile p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.me-profile p:empty { display: none; }
.me-profile .me-action { min-height: 44px; margin-top: 12px; }
.me-auth-actions { display: flex; gap: 8px; }
.me-profile .me-register, .me-settings { display: none; }
.me-action svg { width: 16px; height: 16px; }
.me-details, .me-balance, .me-links { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-large); background: var(--paper); }
.me-details { margin-inline: 0; margin-bottom: 0; padding: 12px 16px; }
.me-details div + div { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.me-details dt { color: var(--muted); font-size: .875rem; }
.me-details dd { margin: 4px 0 0 20px; overflow-wrap: anywhere; white-space: pre-wrap; }
.me-balance { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.me-balance p { font-size: .875rem; font-weight: 650; }
.detail-meta > span > svg, .detail-section h2 > svg, .me-details dt > svg, .me-balance p > svg { width: 16px; height: 16px; color: var(--brand); }
.me-balance strong { display: block; margin-top: 4px; font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.me-balance .button { min-height: 44px; }
.me-balance .button:disabled { cursor: default; }
.me-links a { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; padding: 8px 16px; font-weight: 650; }
.me-links a:first-child { border-radius: var(--radius-large) var(--radius-large) 0 0; }
.me-links a:last-child { border-radius: 0 0 var(--radius-large) var(--radius-large); }
.me-links a + a::before { content: ''; position: absolute; inset: 0 16px auto 64px; height: 1px; background: var(--line); }
.me-links a:hover, .me-links a:active { background: var(--tint); }
.me-links a:focus-visible { outline-offset: -3px; }
.me-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; }
.me-icon svg { width: 21px; height: 21px; stroke-width: 1.9; }
.me-icon-album { background: hsl(36 78% 87%); color: hsl(31 65% 28%); }
.me-icon-support { background: hsl(262 39% 92%); color: hsl(263 33% 37%); }
.me-links > a > svg { width: 18px; height: 18px; color: var(--muted); }
.album-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.album-grid article { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.album-grid .plain { display: block; width: 100%; }
.album-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.album-grid article > div { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; justify-content: space-between; padding: 7px; }
.album-visibility { flex-basis: 100%; padding: 4px; color: var(--muted); font-size: .8125rem; }
.upload { cursor: pointer; position: relative; }
.upload:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; inset: auto; }
.back { margin-bottom: 13px; }

.message-tabs { display: flex; gap: 22px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.message-tabs a { display: inline-flex; gap: 5px; align-items: center; min-height: 44px; padding: 0 3px; border-bottom: 2px solid transparent; color: var(--muted); }
.message-tabs a[aria-current] { color: var(--brand); border-color: var(--brand); font-weight: 700; }
.member-tabs { flex-wrap: wrap; gap: 0 16px; }
.member-pending-count { padding: 3px 6px; border-radius: 5px; background: var(--tint); color: var(--brand-dark); font-size: .75rem; white-space: nowrap; }
.search-box { display: flex; margin: 12px; background: var(--canvas); }
.chat-list .empty, .admin-panel .empty { border: 0; }
.chat-row, .member-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 13px 16px; min-height: 67px; }
.chat-row:last-child, .member-row:last-child { border-bottom: 0; }
.chat-row:hover { background: var(--tint); }
.chat-row p, .member-row p { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: var(--muted); font-size: .875rem; }
.chat-row time, .message time { color: var(--muted); font-size: .75rem; }
.chat-meta { display: grid; justify-items: end; gap: 2px; }
.thread { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: max(410px, calc(100dvh - 176px)); }
.thread-page:has(.message-tabs) .thread { height: max(400px, calc(100dvh - 234px)); }
.thread-head { display: flex; align-items: center; gap: 10px; min-height: 65px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.thread-head .button, .thread-head .safety-button { margin-inline-start: auto; }
.thread-person { min-width: 0; overflow-wrap: anywhere; }
.thread-head h1 { font-size: 1.03rem; }
.thread-head p { color: var(--muted); font-size: .8125rem; }
.thread-messages { flex: 1; background: var(--tint); box-shadow: var(--shadow-inset); overflow-y: auto; padding: 14px; outline-offset: -2px; }
.thread-messages .empty { margin: 12px auto; max-width: 360px; min-height: 145px; }
.message { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0 0 12px; }
.message.own { align-items: flex-end; }
.bubble { max-width: min(80%, 490px); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; background: var(--paper); padding: 8px 11px; box-shadow: 0 1px 2px hsl(344 36% 16% / 8%); }
.own .bubble { border-color: transparent; border-radius: 14px 4px 14px 14px; background: var(--soft); color: var(--brand-dark); }
.bubble p { overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble img { max-height: 240px; border-radius: 8px; }
.bubble button { display: block; }
.composer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 10px; }
.composer textarea { border: 1px solid var(--line); background: var(--canvas); min-height: 42px; max-height: 94px; border-radius: 10px; padding: 9px 10px; box-shadow: var(--shadow-inset); }
.composer .form-error { grid-column: 1 / -1; }

.admin-label { margin: 44px 8px 8px; color: var(--muted); font-size: .8125rem; font-weight: 700; }
.admin-label > svg, .top-title > svg, .support-crown { color: hsl(38 67% 35%); }
.admin-label > svg, .top-title > svg, .support-crown > svg { width: 16px; height: 16px; }
.support-crown { display: inline-grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: hsl(43 76% 90%); vertical-align: middle; }
.is-admin .sidebar nav { margin-top: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-grid article { display: grid; justify-items: start; gap: 4px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-grid strong { margin-top: 3px; font-size: 1.75rem; line-height: 1.2; }
.metric-grid a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.metric-grid article > span:last-child, .metric-grid a { font-size: .875rem; }
.admin-panel > h2 { padding: 14px 16px; font-size: 1.04rem; border-bottom: 1px solid var(--line); }
.registration-panel { margin-bottom: 16px; }
.status-pill { white-space: nowrap; padding: 4px 8px; border-radius: 7px; font-size: .8125rem; color: var(--brand-dark); background: var(--soft); }
.status-pill.replied { color: hsl(154 48% 24%); background: hsl(148 45% 91%); }
.status-pill.closed { color: var(--muted); background: var(--canvas); }
.member-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; }
.member-row .member-mute-status { color: hsl(345 65% 34%); white-space: normal; overflow-wrap: anywhere; }
.report-overview-link { margin-top: 16px; }
.report-list { display: grid; gap: 12px; }
.report-card { display: grid; gap: 8px; padding: 16px; overflow-wrap: anywhere; }
.report-card header, .block-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-card h2 { font-size: 1rem; }
.report-card time { color: var(--muted); font-size: .8125rem; }
.report-details { padding: 12px; border-radius: var(--radius); background: var(--tint); white-space: pre-wrap; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.report-actions .button, .block-row .button { min-height: 44px; }
.block-row { padding-block: 8px; overflow-wrap: anywhere; }
.block-row + .block-row { border-top: 1px solid var(--line); }
.settings-panel { padding: 20px; }

dialog { width: min(450px, calc(100% - 26px)); max-height: calc(100dvh - 30px); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-large); color: var(--ink); background: var(--paper); box-shadow: var(--shadow); overscroll-behavior: contain; }
dialog.wide { width: min(780px, calc(100% - 26px)); }
dialog::backdrop { background: hsl(342 40% 17% / 58%); }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dialog-top h2 { font-size: 1.22rem; overflow-wrap: anywhere; }
.dialog-top .icon-button { width: 36px; height: 36px; min-height: 36px; }
dialog.auth-dialog { width: min(850px, calc(100% - 32px)); padding: 0; }
html:has(dialog.auth-dialog[open]) { overflow: hidden; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .88fr); min-height: 560px; }
.auth-art { position: relative; overflow: hidden; background: var(--night); }
.auth-photo, .auth-art::after { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-photo { object-fit: cover; object-position: center 36%; }
.auth-art::after { content: ''; background: linear-gradient(hsl(348 39% 10% / 56%), transparent 28%); }
.auth-brand { position: absolute; z-index: 1; top: 24px; left: 24px; color: white; text-shadow: 0 1px 10px hsl(347 38% 15% / 90%); }
.auth-brand span { font-size: 1.8rem; }
.auth-panel { align-self: center; min-width: 0; padding: 32px; }
.auth-panel .dialog-top h2 { font-size: 1.6rem; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; margin-top: 8px; }
.auth-links .button.quiet, .auth-panel > .button.quiet { padding-inline: 0; }
.auth-links .button.quiet:hover, .auth-panel > .button.quiet:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.account-options, .push-options { display: grid; gap: 12px; }
.message-sound-option { display: flex; align-items: center; gap: 8px; min-height: 34px; font-weight: 650; }
.account-options .button, .push-options .button, .dialog-actions .button { min-height: 44px; }
.recovery-code { display: block; margin-top: 12px; padding: 12px; background: var(--tint); border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.dialog-copy { color: var(--body); line-height: 1.65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.viewer-image { width: 100%; max-height: 78dvh; object-fit: contain; border-radius: 12px; background: var(--tint); }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: .875rem; font-weight: 650; }
.form label small { display: inline; }
.form input:not([type="checkbox"], [type="range"], .upload input), .form textarea, .form select { background: var(--paper); border: 1px solid var(--field); border-radius: 10px; padding: 8px 10px; min-width: 0; width: 100%; min-height: 41px; }
.form-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.region-fields { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.region-fields legend { margin-bottom: 6px; padding: 0; font-size: .875rem; font-weight: 650; }
.form .region-row { grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; }
.region-row select:disabled { background: var(--tint); border-color: var(--line); color: var(--muted); }
.region-status { color: var(--muted); font-size: .8125rem; }
.region-status:empty, .region-actions:not(:has(button:not([hidden]))) { display: none; }
.region-actions { display: flex; justify-content: flex-end; gap: 8px; }
.region-actions .button { min-height: 44px; }
.form .check-line { display: flex; gap: 8px; align-items: center; min-height: 32px; }
.check-line input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-error { color: hsl(345 70% 36%); font-size: .875rem; }
.welcome-avatar { display: grid; gap: 12px; text-align: center; }
.welcome-avatar .dialog-actions { justify-content: center; margin-top: 0; }
.avatar-form .crop-choose { display: flex; min-height: 44px; }
.crop-status { color: var(--muted); font-size: .875rem; }
.crop-status:empty { display: none; }
.crop-preview { display: grid; justify-items: center; gap: 8px; }
.crop-frame { position: relative; width: min(100%, 256px); overflow: hidden; border-radius: var(--radius); background: var(--soft); }
.crop-frame::after { content: ''; position: absolute; inset: 0; border: 1px solid white; border-radius: 50%; box-shadow: 0 0 0 80px hsl(80 16% 13% / 58%); pointer-events: none; }
.crop-frame canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.crop-frame canvas:active { cursor: grabbing; }
.crop-frame:focus-within { outline: 2px solid var(--brand); outline-offset: 3px; }
.crop-preview p { color: var(--muted); font-size: .875rem; }
.avatar-form .crop-zoom { display: flex; align-items: center; width: min(100%, 256px); gap: 12px; }
.crop-zoom input { flex: 1; min-width: 0; min-height: 44px; margin: 0; accent-color: var(--brand); }
.form + .button { margin-top: 8px; }
.terms-detail { font-size: .875rem; color: var(--brand-dark); }
.terms-detail p { margin-block: 5px; }
#toast { position: fixed; z-index: 12; left: 50%; transform: translateX(-50%); bottom: 20px; width: max-content; max-width: calc(100vw - 30px); background: var(--ink); color: var(--paper); border-radius: 8px; padding: 9px 16px; box-shadow: var(--shadow); font-size: .875rem; }

@media (max-width: 1110px) {
  :root { --sidebar: 190px; }
  .sidebar { padding-inline: 14px; }
  .sidebar .brand span { font-size: 1.38rem; }
  #content { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
}
@media (max-width: 850px) {
  :root { --sidebar: 160px; }
  .sidebar { padding-inline: 10px; }
  .sidebar .brand img { width: 25px; height: 25px; }
  .sidebar .brand span { font-size: 1.15rem; }
  .person-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  :root {
    --mobile-gutter: clamp(12px, 4vw, 16px);
    --mobile-nav-height: calc(64px + env(safe-area-inset-bottom));
  }
  .workspace { display: block; }
  .sidebar, .top-title, .top-search { display: none; }
  .topbar { min-height: calc(60px + env(safe-area-inset-top)); padding-block: calc(8px + env(safe-area-inset-top)) 8px; padding-inline: max(var(--mobile-gutter), env(safe-area-inset-left)) max(var(--mobile-gutter), env(safe-area-inset-right)); background: var(--paper); }
  .workspace:not(.is-admin) .topbar { display: none; }
  .is-admin .top-title { display: block; white-space: nowrap; }
  .top-actions .front-link { display: inline-flex; }
  .is-admin .account summary span:not(.avatar) { display: none; }
  .top-actions { gap: 4px; }
  .top-actions .button { min-height: 44px; padding-inline: 11px; }
  #content { padding-block: 22px calc(var(--mobile-nav-height) + 16px); padding-inline: max(var(--mobile-gutter), env(safe-area-inset-left)) max(var(--mobile-gutter), env(safe-area-inset-right)); }
  .workspace:not(.is-admin) #content { padding-top: max(16px, calc(8px + env(safe-area-inset-top))); }
  .me-settings { display: block; position: absolute; inset: 8px 8px auto auto; }
  .me-settings summary { justify-content: center; width: 44px; padding: 0; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-low); }
  .me-settings summary svg { width: 22px; height: 22px; }
  .me-profile .me-register { display: inline-flex; }
  .mobile-nav { display: flex; position: fixed; inset: auto 0 0; z-index: 5; height: var(--mobile-nav-height); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: var(--paper); border-top: 1px solid var(--line); }
  .workspace:not(.is-admin) .mobile-nav {
    inset: auto max(12px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    height: 58px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-large);
    box-shadow: 0 -2px 10px hsl(344 36% 16% / 6%), var(--shadow-low);
  }
  .mobile-nav a { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: .75rem; line-height: 1.2; }
  .mobile-nav a svg { position: relative; width: 23px; height: 23px; }
  .mobile-nav a[aria-current] { color: var(--brand); font-weight: 750; }
  .mobile-nav a[aria-current]::before { content: ''; width: 42px; height: 28px; background: var(--soft); border-radius: 999px; position: absolute; top: calc(50% - 24px); }
  .mobile-nav a:focus-visible { outline-offset: -3px; }
  .mobile-nav .nav-count { position: absolute; top: 7px; margin-left: 32px; }
  .directory-head { margin-bottom: 14px; }
  .directory-head h1 { font-size: clamp(1.875rem, 8.4vw, 2.5rem); }
  #discover-count { font-size: .8125rem; }
  .directory-controls { align-items: stretch; flex-direction: column; gap: 8px; padding-bottom: 10px; margin-bottom: 12px; }
  .discover-search { width: 100%; }
  .discover-search input, .search-box input { min-height: 44px; font-size: 1rem; }
  .filters button { min-height: 44px; }
  .person-grid { gap: 16px 12px; }
  .person-photo { aspect-ratio: 4 / 5; }
  .person-photo img { object-position: center; }
  .person-card { padding-bottom: 9px; }
  .person-name { font-size: 1.06rem; }
  .person-card .person-meta { gap: 4px; }
  .person-city:not(:first-child) { padding-inline-start: 4px; }
  .detail-header { grid-template-columns: minmax(0, 1fr); }
  .detail-portrait { border-radius: var(--radius-large) var(--radius-large) 0 0; }
  .detail-identity, .detail-section { padding: 16px; }
  .detail-identity h1 { font-size: 1.75rem; }
  .person-bio { font-size: .8125rem; }
  .button.greet { width: 44px; border-radius: 50%; padding: 0; }
  .button.greet span { display: none; }
  .album-grid, .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-grid .button { min-height: 40px; }
  .page-heading { margin: 0 0 16px; }
  .page-heading h1 { font-size: 1.75rem; }
  .page-heading p { font-size: .875rem; }
  .back { min-height: 44px; margin-bottom: 4px; }
  .message-tabs { margin-bottom: 12px; }
  .message-tabs a { min-width: 56px; justify-content: center; }
  .thread-page { display: flex; flex-direction: column; width: 100%; min-height: 0; }
  .thread-page > .back { align-self: flex-start; }
  .thread-page .message-tabs { margin-bottom: 8px; }
  .thread-head { min-height: 56px; }
  .thread-head .avatar { width: 36px; height: 36px; }
  .thread-messages { min-height: 0; overscroll-behavior-y: contain; }
  .member-row { grid-template-columns: auto minmax(0, 1fr); }
  .member-actions { grid-column: 2; justify-content: start; }
  .member-actions .button { min-height: 44px; }
  .composer .button, .composer .icon-button, .composer textarea { min-height: 44px; }
  .composer .button { padding-inline: 9px; }
  .composer .icon-button { width: 44px; }
  .composer textarea { font-size: 1rem; }
  .form input:not([type="checkbox"], [type="range"], .upload input), .form textarea, .form select { min-height: 44px; font-size: 1rem; }
  .dialog-top .icon-button { width: 44px; height: 44px; }
  .form .button { min-height: 44px; }
  dialog.auth-dialog { inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .auth-layout { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 100%; padding: calc(clamp(195px, 28dvh, 240px) + env(safe-area-inset-top)) max(12px, var(--mobile-gutter), env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(12px, var(--mobile-gutter), env(safe-area-inset-left)); }
  .auth-art { position: absolute; z-index: -1; inset: 0; }
  .auth-art::after { background: linear-gradient(hsl(348 39% 10% / 58%), transparent 24%, transparent 47%, hsl(349 34% 9% / 66%)); }
  .auth-layout:has([data-form="register"]) .auth-photo { height: min(100%, 66dvh); mask-image: linear-gradient(black 64%, transparent); }
  .auth-brand { top: calc(16px + env(safe-area-inset-top)); left: max(12px, var(--mobile-gutter), env(safe-area-inset-left)); }
  .auth-panel { width: min(100%, 440px); padding: 16px; border-radius: var(--radius-large); border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
  .auth-panel .dialog-top { margin-bottom: 10px; }
  .auth-panel .dialog-top h2 { font-size: 1.45rem; }
  .auth-panel > .button.quiet { min-height: 44px; }
  #toast { bottom: calc(var(--mobile-nav-height) + 8px); }
  html:has(.thread-page) { overflow: hidden; }
  .workspace:has(.thread-page) .stage { position: fixed; inset: var(--chat-top, 0px) 0 auto; display: flex; flex-direction: column; height: calc(var(--chat-height, 100dvh) - var(--thread-nav-height, var(--mobile-nav-height))); }
  .workspace:has(.thread-page) #content { display: flex; flex: 1; min-height: 0; padding-block: calc(4px + env(safe-area-inset-top)) 8px; }
  .is-admin:has(.thread-page) #content { padding-top: 4px; }
  .workspace:has(.thread-page) .thread { height: auto; min-height: 0; flex: 1; }
  .chat-keyboard .workspace:has(.thread-page) { --thread-nav-height: 0px; }
  .chat-keyboard .workspace:has(.thread-page) .mobile-nav { display: none; }
}
@media (max-width: 650px) and (max-height: 500px) {
  .workspace:has(.thread-page) { --thread-nav-height: 0px; }
  .workspace:has(.thread-page) .mobile-nav { display: none; }
}
