:root {
  color-scheme: light;
  --paper: #ffffff;
  --dim: #a6adb0;
  --accent-soft: #f7ced9;
  --mint: var(--accent-soft);
  --coral: #ff7f91;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--native-safe-top, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--native-safe-right, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--native-safe-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--native-safe-left, 0px));
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #ffffff; color: #252525; overscroll-behavior: none; }
body {
  height: 100dvh; display: grid; place-items: center; overflow: hidden;
  background: #ffffff;
}
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--mint); outline-offset: 5px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.app-shell {
  position: relative; isolation: isolate; width: min(100%, 440px); height: min(calc(100dvh - 56px), 920px);
  background: #ffffff; overflow: hidden; border: 1px solid #eeeeee; border-radius: 28px;
  box-shadow: 0 16px 60px #0000000d; outline: none; touch-action: pan-y;
}
.app-shell:fullscreen { width: 100%; height: 100%; border-radius: 0; border: 0; max-width: none; }
/* The installed Flutter container owns the screen, including landscape/iPad. */
html[data-native-host=true] body { display: block; background: #ffffff; }
html[data-native-host=true] .app-shell { width: 100%; height: 100dvh; max-width: none; border: 0; border-radius: 0; box-shadow: none; }
/* Native shells own the physical top/side safe rectangle. Use only the reported
   residual insets: the main menu and comment dock can extend its bottom edge.
   Do not re-apply browser env() insets inside an already inset coordinate system. */
html[data-native-host=true][data-native-safe-area=contained] {
  --safe-top: var(--native-safe-top, 0px); --safe-right: var(--native-safe-right, 0px);
  --safe-bottom: var(--native-safe-bottom, 0px); --safe-left: var(--native-safe-left, 0px);
}
html[data-native-host=true] .desktop-signature,
html[data-native-host=true] .desktop-footnote { display: none; }
.icon { display: inline-flex; width: 25px; height: 25px; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; display: block; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; fill: none; }
.pill { margin-top: 14px; padding: 11px 21px; background: var(--mint); color: #22181b; border-radius: 30px; font-size: 12px; font-weight: 600; }
.toast {
  position: absolute; z-index: 35; top: calc(100px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  padding: 12px 18px; border-radius: 12px; background: #38252def; border: 1px solid #ffffff16;
  color: #fcf5f7; box-shadow: 0 8px 30px #0004; width: max-content; max-width: 86%; font-size: 12px; line-height: 1.6; text-align: center;
}
.desktop-signature { position: fixed; left: max(35px, calc(50% - 430px)); top: 46%; display: flex; align-items: center; gap: 15px; color: #252525; font-size: 26px; letter-spacing: 4px; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; padding: 0; border-radius: 16px; overflow: hidden; flex: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.desktop-signature small { display: block; font-size: 10px; letter-spacing: 2px; margin-top: 12px; color: #888888; }
.desktop-footnote { position: fixed; bottom: 4px; margin: 0; color: #999999; font-size: 10px; letter-spacing: 1px; }
.desktop-footnote span { margin: 0 8px; }

/* Loading and recovery use the same calm surface as the post feed. */
.app-status {
  position: absolute; inset: 0 0 var(--social-nav-height, 0px); z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: calc(30px + var(--safe-top)) calc(28px + var(--safe-right)) 30px calc(28px + var(--safe-left));
  background: #ffffff; color: #252525; text-align: center;
}
.app-status h1 { margin: 0; font-size: 21px; line-height: 1.45; font-weight: 650; }
.app-status p { margin: 0; max-width: 28em; font-size: 13px; line-height: 1.8; color: #777777; overflow-wrap: anywhere; }
.app-status .pill { background: var(--social-accent-strong, #d63379); color: #fff; min-height: 44px; }
.spinner { width: 22px; height: 22px; border: 2px solid #cbb7bc; border-top-color: #53313a; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* A single local identity for reading, sharing and private messages. */
.user-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: #f4f4f4; color: #555555; font-size: 15px; overflow: hidden; flex: none; }
.user-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.profile-screen { position: absolute; inset: 0; z-index: 18; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; color-scheme: light; color: #252525; background: #ffffff; }
.profile-header { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 40px minmax(0,1fr) 40px; align-items: center; gap: 10px; min-height: 56px; padding: calc(7px + var(--safe-top)) calc(16px + var(--safe-right)) 7px calc(16px + var(--safe-left)); background: #ffffff65; -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%); border-bottom: 1px solid #ffffff90; }
.profile-heading { min-width: 0; margin: 0; text-align: center; font-size: 14px; font-weight: 600; letter-spacing: .03em; }
.profile-back,.profile-header-spacer { width: 40px; height: 40px; }
.profile-back { display: grid; place-items: center; border-radius: 50%; color: #555555; }
.profile-back:before { content: ''; width: 9px; height: 9px; border: solid currentColor; border-width: 0 0 1.8px 1.8px; transform: translateX(2px) rotate(45deg); }
.profile-back:hover { background: #ffffff90; }
.profile-screen button:focus-visible,.profile-uid summary:focus-visible { outline: 2px solid #f65398; outline-offset: 3px; }
.profile-body { width: 100%; max-width: 620px; margin: 0 auto; padding: 20px calc(18px + var(--safe-right)) calc(28px + var(--safe-bottom)) calc(18px + var(--safe-left)); }
.account-identity-card { padding: 22px; border: 1px solid #eeeeee; border-radius: 26px; background: #ffffff; box-shadow: inset 0 1px 0 #ffffff90,0 8px 24px #462b3209; -webkit-backdrop-filter: blur(24px) saturate(135%); backdrop-filter: blur(24px) saturate(135%); }
.profile-identity { display: flex; align-items: center; gap: 17px; }
.profile-identity-copy { flex: 1; min-width: 0; }
.profile-avatar { width: 74px; height: 74px; font-size: 29px; border: 3px solid #fff; background: #f4f4f4; color: #555555; box-shadow: 0 0 0 1px #eeeeee; }
.profile-status { font-size: 12px; color: #777777; line-height: 1.8; margin: 17px 0 0; }
.profile-name { font-size: 22px; line-height: 1.35; margin: 0 0 7px; font-weight: 700; letter-spacing: -.4px; overflow-wrap: anywhere; }
.profile-uid { font-size: 10px; color: #888888; line-height: 1.7; font-variant-numeric: tabular-nums; margin: 0; }
.profile-uid summary { width: fit-content; cursor: pointer; list-style: none; border-radius: 5px; }
.profile-uid summary::-webkit-details-marker { display: none; }
.profile-uid summary:after { content: '⌄'; margin-left: 7px; }.profile-uid[open] summary:after { content: '⌃'; }
.profile-uid p { margin: 5px 0 0; overflow-wrap: anywhere; user-select: all; }
.profile-bio { font-size: 13px; color: #666666; line-height: 1.8; margin: 17px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.account-settings-list { display: grid; margin-top: 18px; padding: 5px 17px; border: 1px solid #eeeeee; border-radius: 24px; background: #ffffff; }
.account-settings-row { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 78px; padding: 14px 0; text-align: left; }
.account-settings-row+.account-settings-row { border-top: 1px solid #eeeeee; }
.account-settings-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 14px; background: #ffffff; color: #f65398; }
.account-settings-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.account-settings-copy { display: grid; gap: 5px; min-width: 0; flex: 1; }.account-settings-copy strong { font-size: 13px; font-weight: 600; }.account-settings-copy small { color: #888888; font-size: 11px; }
.account-settings-chevron { flex: none; width: 7px; height: 7px; margin: 0 4px; border: solid #999999; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.profile-button { min-height: 44px; padding: 12px 20px; border-radius: 999px; border: 1px solid #e8e8e8; background: #ffffff; color: #555555; font-size: 13px; font-weight: 600; line-height: 1.4; text-align: center; }
.profile-button.subtle { background: #ffffff; }.profile-button.primary { background: var(--social-accent-strong, #d63379); border-color: var(--social-accent-strong, #d63379); color: #fff; }
.profile-button:disabled { opacity: .55; }.profile-button.primary:hover:not(:disabled) { background: #a92346; }
.account-local-note { font-size: 10px; line-height: 1.8; margin: 21px 12px 0; text-align: center; color: #888888; }
.account-page-title { font-size: 22px; font-weight: 650; margin: 7px 0 12px; }
.account-list { display: grid; gap: 10px; margin-top: 22px; }
.account-row { display: flex; align-items: center; gap: 13px; width: 100%; padding: 17px; border: 1px solid #eeeeee; border-radius: 21px; text-align: left; background: #ffffff; }
.account-row[aria-current=true] { border-color: #f65398; background: #ffffff; }.account-row .user-avatar { width: 42px; height: 42px; background: #f4f4f4; }
.account-row-copy { display: grid; gap: 6px; min-width: 0; flex: 1; }.account-row-copy strong { font-size: 13px; overflow-wrap: anywhere; }.account-row-copy small { font-size: 9px; color: #888888; word-break: break-all; line-height: 1.6; }
.account-current { padding: 5px 8px; border-radius: 999px; background: #f9e7ed; font-size: 10px; color: #d63379; white-space: nowrap; }
.account-create { margin-top: 22px; width: 100%; }
.account-form { display: grid; gap: 19px; margin-top: 18px; }
.account-form-fields { display: grid; gap: 22px; padding: 22px; background: #ffffff; border: 1px solid #eeeeee; border-radius: 24px; }
.account-form label { display: grid; gap: 9px; font-size: 12px; font-weight: 600; color: #555555; }
.account-form input,.account-form textarea { width: 100%; border: 1px solid #e8e8e8; background: #ffffff; border-radius: 15px; padding: 12px 14px; color: #252525; font: inherit; font-size: 16px; font-weight: 400; resize: vertical; line-height: 1.7; outline: none; }
.account-form input:focus,.account-form textarea:focus { border-color: #f65398; box-shadow: 0 0 0 3px #f6539812; }
.account-form input::placeholder,.account-form textarea::placeholder { color: #999999; font-size: 13px; }
.account-form-error { font-size: 12px; line-height: 1.8; color: #b64a58; min-height: 0; margin: 0; }.account-form-error:empty { display: none; }
@media(max-width:360px) { .profile-body { padding-left: 14px; padding-right: 14px; }.account-identity-card,.account-form-fields { padding: 18px; }.profile-avatar { width: 64px; height: 64px; font-size: 26px; }.profile-name { font-size: 20px; } }

@media (max-width: 780px) {
  .desktop-signature, .desktop-footnote { display: none; }
  .app-shell { width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
}
@media (max-width: 390px) {
  .profile-body { padding-left: calc(20px + var(--safe-left)); padding-right: calc(20px + var(--safe-right)); }
}
@media (orientation: landscape) and (max-height: 600px) {
  .desktop-signature, .desktop-footnote { display: none; }
  .app-shell { width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .profile-body { max-width: 680px; margin: auto; padding-top: 20px; }
  .profile-avatar { width: 64px; height: 64px; }
  .profile-name { margin-top: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .spinner { animation-duration: 1.6s; }
}
