:root {
  color-scheme: light;
  --wall: #E4E4E0;
  --wall-hover: #D9D9D4;
  --paper: #FCFCFA;
  --ink: #1B1B1A;
  --ink-2: #3A3A37;
  --muted: #595955;
  --rule: #D9D8D3;
  --rule-wall: #CFCECA;
  --rule-strong: #9A9A95;
  --vermilion: #B8321E;
  --on-vermilion: #FFFFFF;
  --scrim: rgba(27,27,26,.52);
  --shadow-slip: 0 1px 2px rgba(27,27,26,.06), 0 2px 8px -4px rgba(27,27,26,.10);
  --shadow-notice: 0 1px 2px rgba(27,27,26,.06), 0 8px 20px -8px rgba(27,27,26,.16), 0 24px 48px -24px rgba(27,27,26,.20);
  --shadow-modal: 0 2px 6px rgba(27,27,26,.08), 0 32px 72px -20px rgba(27,27,26,.40);
  --shadow-none: none;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --title-size: 30px;
  --feature-size: 46px;
  --notice-size: 24px;
  --slip-size: 20px;
  --label-size: 15px;
  --body-size: 16px;
  --data-size: 26px;
  --small-size: 13px;
  --gutter: 36px;
  --feature-padding: 48px 56px;
  --notice-padding: 32px 36px;
  --slip-padding: 22px 24px;
  --mobile-nav-height: 0px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--wall);
  background-image: url(/assets/texture/wall-grain.svg);
  background-blend-mode: multiply;
  color: var(--ink);
  font: var(--body-size) / 1.7 var(--sans);
  overflow-wrap: anywhere;
}

@media (prefers-reduced-transparency: reduce), print {
  body { background-image: none; }
}

body:has(dialog[open]) { overflow: hidden; }

h1, h2, h3, p, dl, dd, ol { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.4; }
h1 { font-size: var(--title-size); }
h2, h3 { font-size: var(--slip-size); }

img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; accent-color: var(--ink); border-radius: 0; }
button { border: 0; padding: 0; background: none; cursor: pointer; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: fixed;
  inset: 8px auto auto 8px;
  z-index: 5;
  padding: 8px 16px;
  background: var(--paper);
  translate: 0 -200%;
}

.skip-link:focus { translate: none; }

.primary-button, .outline-button, .attention-button, .text-button, .icon-button, .filter-button, .type-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: var(--label-size);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.primary-button { color: var(--on-vermilion); background: var(--vermilion); min-height: 48px; font-size: var(--body-size); }
.outline-button, .attention-button { border: 1px solid var(--ink); }
a:is(.primary-button, .outline-button) { text-decoration: none; }
.attention-button { color: var(--vermilion); border-color: var(--vermilion); }
.text-button { padding-inline: 0; text-decoration: underline; text-underline-offset: 4px; }
.icon-button { padding: 0; }
button:disabled { opacity: .65; cursor: wait; }

@media (hover: hover) {
  button.primary-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
  .outline-button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
  .attention-button:hover:not(:disabled) { background: var(--vermilion); color: var(--on-vermilion); }
  .text-button:hover, .title-button:hover, .row-link:hover .slip-title { text-decoration: underline; text-underline-offset: 4px; }
  .icon-button:hover:not(:disabled) { background: var(--wall-hover); }
}
.icon-button:active:not(:disabled) { background: var(--rule-wall); }
.outline-button:active:not(:disabled) { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }
.primary-button:active:not(:disabled) { background: var(--ink-2); color: var(--paper); text-decoration: none; }

.site-width { width: min(100% - 2 * var(--gutter), 1200px); margin-inline: auto; }
.page { padding-bottom: calc(80px + var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 24px; }
.brand { display: inline-flex; align-items: center; flex: none; gap: 12px; min-height: 44px; }
.brand-mark { display: block; flex: none; width: 34px; }
.brand-mark img { width: 100%; height: auto; }
.brand-name { font: 700 var(--slip-size) var(--serif); letter-spacing: .06em; }
.topbar-actions, .desktop-nav { display: flex; align-items: center; }
.topbar-actions { min-width: 0; gap: 4px; }
.desktop-nav { gap: 32px; }
.topbar-actions > button { position: relative; height: 40px; min-height: 0; }
.topbar-actions > button::after { content: ""; position: absolute; inset: -2px; }
.topbar-actions .icon-button { min-width: 40px; }
.topbar-actions .outline-button { flex: none; padding: 0 18px; }
.topbar-divider { flex: 0 0 1px; height: 20px; margin-inline: 8px; background: var(--rule-wall); }
.account-button { min-width: 0; gap: 4px; padding: 0 8px 0 12px; font-weight: 500; }
.current-nickname { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button svg { width: 16px; height: 16px; }
.account-button svg:last-child, body:has(dialog.settings-dialog[open]) .account-button svg:first-of-type { display: none; }
body:has(dialog.settings-dialog[open]) .account-button svg:last-child { display: block; }
.nav-item { min-height: 44px; font-size: var(--label-size); }
.desktop-nav .nav-item, .filter-button {
  position: relative;
  display: grid;
  grid-template-rows: 0 auto;
  place-content: center;
  gap: 0;
  white-space: nowrap;
  color: var(--ink-2);
}
.desktop-nav .nav-item::before, .filter-button::before {
  content: attr(data-label) / "";
  font-weight: 700;
  visibility: hidden;
  height: 0;
  display: block;
  overflow: hidden;
}
.desktop-nav .nav-item::after, .filter-button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
}
.desktop-nav .nav-item { min-height: 40px; }
.desktop-nav .nav-item > span::after { content: ""; position: absolute; inset: -2px 0; }
@media (hover: hover) {
  .desktop-nav .nav-item:hover, .filter-button:hover { color: var(--ink); }
  .desktop-nav .nav-item:hover::after, .filter-button:hover::after { background: var(--rule-strong); }
}
.nav-item:is(.active, [aria-current="page"]), .filter-button.active { color: var(--ink); font-weight: 700; }
.desktop-nav .nav-item:is(.active, [aria-current="page"])::after, .filter-button.active::after { background: var(--ink); }
.notifications-button { width: 40px; flex: none; }
.nav-badge { position: absolute; top: 4px; min-width: 16px; height: 16px; padding-inline: 4px; border-radius: 8px; font-size: var(--small-size); line-height: 16px; background: var(--vermilion); color: var(--on-vermilion); font-variant-numeric: tabular-nums; }
.notifications-button .nav-badge { top: 5px; right: 4px; }
.bottom-nav { display: none; }
.demo-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--rule-wall); color: var(--muted); font-size: var(--small-size); }
.demo-label a { color: var(--ink); flex: none; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-block: 24px 16px; }
.page-heading p, .muted, .notice-number, dt, .field-help, .info-note, .share-hint { color: var(--muted); font-size: var(--small-size); }
.heading-copy { display: grid; gap: 4px; }
.page-heading .outline-button { flex: none; }
.mascot { width: 120px; flex: none; }
.paper { background: var(--paper); padding: var(--notice-padding); box-shadow: var(--shadow-slip); }
.section-heading { font: 700 var(--label-size) / 1.4 var(--sans); }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-title .text-button { font-size: var(--small-size); }
.attention, .form-error, .closed-check { color: var(--vermilion); font-weight: 700; }
.todo-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--vermilion); }
.todo-label { display: flex; align-items: center; gap: 8px; }
.notice-number { text-align: end; }
.notice-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.notice-address { font: 700 var(--slip-size) / 1.4 var(--serif); letter-spacing: .06em; }
.notice-circles { display: inline-flex; align-items: center; gap: 8px; flex: none; font: 900 var(--notice-size) var(--serif); }
.notice-circles span { display: grid; place-items: center; width: 2em; height: 2em; border: 2px solid var(--vermilion); border-radius: 50%; }
.notice-signoff {
  --seal-size: 56px;
  flex: none;
  display: grid;
  grid-template-areas: "seal date";
  justify-content: end;
  align-content: center;
  align-items: center;
  column-gap: 4px;
  min-width: 80px;
  min-height: 80px;
  color: var(--muted);
  font-size: var(--small-size);
}
.signoff-date { grid-area: date; writing-mode: vertical-rl; }
.notice-signoff b { color: var(--vermilion); }
.notice-signoff .seal { grid-area: seal; width: var(--seal-size); aspect-ratio: 1; opacity: .88; }
.facts { display: flex; flex-wrap: wrap; align-items: start; gap: 12px 36px; padding-block: 16px; border-block: 1px solid var(--rule); border-top-color: var(--ink); }
.facts dd { font-size: var(--data-size); line-height: 1.4; font-weight: 500; font-variant-numeric: tabular-nums; }
.facts .fact-names dd, .facts dd .attention { font-size: var(--label-size); }
.facts .fact-names { flex: 1 1 180px; }

.confirm-strip { display: flex; align-items: center; gap: 8px; padding: 4px 8px; width: 100%; min-height: 44px; border-block: 1px solid var(--rule-wall); text-align: start; font-size: var(--label-size); }
.confirm-strip > :last-child { margin-inline-start: auto; flex: none; }
.confirm-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-heading { align-items: center; min-height: 140px; }
.lobby-heading .heading-copy { min-width: 0; gap: 2px; }
.lobby-heading h1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-weight: 700;
  line-height: 1.2;
}
.lobby-heading p { line-height: 1.2; }
.lobby-heading .lobby-tagline { font-size: 15px; }
.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  grid-template-areas: "main notices" "main rankings" "links rankings";
  grid-template-rows: min-content 1fr auto;
  gap: 16px 36px;
  align-items: start;
}
.lobby-main { grid-area: main; }
.lobby-others { grid-area: notices; }
.lobby-links { grid-area: links; }
.lobby-rank { grid-area: rankings; }
.featured { padding: var(--feature-padding); }
.featured, .todo-paper, .detail-paper { box-shadow: var(--shadow-notice); }
.featured h2 { margin-top: 36px; font-size: var(--feature-size); font-weight: 900; line-height: 1.25; }
.title-button { display: inline-block; min-height: 44px; font: inherit; text-align: start; overflow-wrap: anywhere; max-width: 100%; }
.featured .title-button { cursor: pointer; }
.featured .description, .detail-desc { color: var(--ink-2); white-space: pre-wrap; margin-top: 12px; margin-bottom: 24px; }
.featured .facts { margin-top: 24px; }
.featured-footer, .detail-signature, .join-foot { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-top: 16px; }
.featured-footer .muted { margin-top: 8px; }
.featured-footer .primary-button { min-width: 148px; }
.lobby-links { justify-content: space-between; }
.lobby-others .section-heading { margin-bottom: 12px; }
.lobby-others .row-link { display: grid; gap: 4px; padding: 0; }
.lobby-others .row-end { max-width: none; text-align: start; }
.ongoing-count { display: block; }
.slip-list, .form-stack, .settings-list { display: grid; gap: 12px; }
.notice-slip { padding: var(--slip-padding); }
.slip-title { font: 700 var(--slip-size) / 1.4 var(--serif); }
.wall-row { border-bottom: 1px solid var(--rule-wall); }
.row-link { width: 100%; min-width: 44px; min-height: 44px; display: flex; align-items: center; gap: 8px; text-align: start; padding-block: 8px; }
.row-copy { display: grid; min-width: 0; flex: 1; }
.row-end { font-size: var(--small-size); color: var(--muted); text-align: end; max-width: 40%; }
.rank-list { display: grid; grid-template-columns: minmax(48px, max-content) minmax(0, 1fr) minmax(4ch, max-content) auto; column-gap: 8px; border-top: 1px solid var(--ink); margin-top: 8px; }
.rank-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(48px, max-content) minmax(0, 1fr) 4ch 8ch; grid-template-columns: subgrid; gap: 8px; align-items: center; border-bottom: 1px solid var(--rule-wall); padding-block: 12px; }
.paper .rank-row { border-color: var(--rule); }
.paper .rank-row:last-child:not(.rank-self) { border-color: transparent; }
.rank-position { font: 900 30px/1 var(--serif); }
.rank-score, .rank-movement, .numeric { font-variant-numeric: tabular-nums; }
.rank-name { font-size: 17px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-movement, .rank-score, .persona-suffix { font-size: 13px; }
.rank-movement, .rank-score { text-align: end; white-space: nowrap; }
.rank-movement { min-height: 1.3em; color: var(--ink); line-height: 1.3; }
.rank-score, .persona-suffix { color: var(--muted); }
.persona-suffix { white-space: nowrap; }
.rank-row.rank-self { border-bottom: 2px solid var(--ink); }
.rank-self .rank-name { font-weight: 700; }
.rank-you, .persona-suffix { font-weight: 400; }
.roster-entry { display: inline-block; }
.ranking-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 24px; }
.ranking-layout .info-note, .rank-receipt { margin-top: 16px; }
.rank-note { margin-top: 12px; font-size: 13px; }
.ledger-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--rule-wall); padding-block: 8px; }
.ledger-copy { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; min-width: 0; }
.ledger-subject { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-outcome { color: var(--muted); font-size: var(--small-size); white-space: nowrap; }
.ledger-row .numeric { flex: none; white-space: nowrap; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; border-bottom: 1px solid var(--rule-wall); }
.filter-button { font-weight: 400; padding-inline: 4px; }
.archive-section { margin-top: 36px; }
.archive-section .section-heading { margin-bottom: 12px; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.todo-paper { display: flex; flex-direction: column; gap: 12px; }
.todo-paper h3 { font-size: var(--notice-size); font-weight: 900; }
.todo-meta .attention { margin-inline-start: 8px; }
.todo-action { align-self: start; margin-top: auto; }
.todo-mobile { display: none; }
.empty-state { padding: 36px 0; }
.empty-state > * + * { margin-top: 8px; }
.empty-state img { width: 96px; }

.detail-page, .identity-page { width: min(100%, 720px); margin-inline: auto; }
.detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.detail-paper h1 { font-size: var(--notice-size); font-weight: 900; margin-top: 24px; text-wrap: balance; }
.detail-signature > p { font-size: var(--small-size); color: var(--muted); }
.detail-action-bar, .identity-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.detail-actions { margin-top: 16px; }
.detail-actions .info-note { margin-top: 8px; }
.detail-action-bar .primary-button { min-width: 148px; }
.participants, .participant + .participant, .extension-box, .reactions { margin-top: 16px; }
.participants > .info-note { margin-bottom: 8px; }
.participant, .extension-box, .reactions { border-top: 1px solid var(--rule); padding-top: 12px; }
.participant-info { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.participant-status, .pending-note { color: var(--muted); font-size: var(--small-size); }
.participant-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.reactions summary { cursor: pointer; min-height: 44px; }

.identity-page { width: min(100% - 2 * var(--gutter), 496px); }
.identity-brand { padding-block: 16px; }
.welcome-intro { position: relative; isolation: isolate; min-height: 196px; display: grid; align-content: center; gap: 8px; padding: 12px 16px 24px; }
.welcome-intro h1 { max-width: 65%; }
.welcome-intro p { max-width: 57%; }
.welcome-intro img { position: absolute; z-index: -1; right: 0; bottom: 0; width: min(180px, 46%); }
.identity-heading { margin-bottom: 16px; }
.unavailable-description { margin-bottom: 24px; }
.identity-page .primary-button { width: 100%; }
.identity-page .form-stack .info-note { text-align: center; }
.identity-extras { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.homeless-footer { overflow-wrap: anywhere; }
@media (min-width: 881px) {
  .welcome-intro p { max-width: 300px; }
}
.join-paper { position: relative; }
.join-paper h1 { margin-top: 8px; }
.join-paper .identity-members { color: var(--ink-2); margin-block: 8px 16px; }
.join-mascot { width: 104px; margin: -12px 0 0 auto; position: relative; }
.join-mascot + .identity-extras { margin-top: -44px; justify-content: start; }
.join-foot { margin-top: 0; }

dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(100% - 2 * var(--gutter), 600px);
  height: fit-content;
  max-height: calc(100dvh - 96px);
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-modal);
}

dialog::backdrop { background: var(--scrim); }
#modal-content, .modal-frame { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.modal-header { display: flex; flex: none; align-items: start; justify-content: space-between; gap: 12px; padding: 28px 36px 20px; }
.modal-header h2 { font-size: 24px; font-weight: 700; }
.modal-subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-header .icon-button { flex: none; width: 40px; height: 40px; min-width: 0; min-height: 0; position: relative; }
.modal-header .icon-button::after { content: ""; position: absolute; inset: -2px; }
.modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 36px 28px; scroll-padding-block: 4px; }
.modal-body:empty { display: none; }
.modal-body .info-note { font-size: 13px; }
.modal-footer { position: relative; flex: none; border-top: 1px solid var(--rule); padding: 16px 36px 24px; }
.modal-footer > .form-error { margin-bottom: 8px; }
.modal-footer-actions { display: flex; align-items: center; gap: 8px 16px; }
.modal-footer .primary-button { width: 220px; min-height: 52px; margin-inline-start: auto; }

.field { display: grid; gap: 4px; min-width: 0; align-content: start; }
.field label, .settings-label { color: var(--muted); font-size: 13px; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--rule); background: transparent; }
.field textarea { min-height: 66px; resize: vertical; }
.field .main-field { border-color: var(--ink); font: 700 var(--slip-size) / 1.4 var(--serif); }
.field :is(input:where(:not([type]), [type="text"], [type="search"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="number"], [type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]), select, textarea):focus,
.stepper:has(> input:focus),
.persona-title-field:focus-within {
  outline: none;
  border-bottom-color: var(--field-focus-ink, var(--ink));
  box-shadow: inset 0 -1px var(--field-focus-ink, var(--ink));
}
.field [aria-invalid="true"], .stepper:has(> input[aria-invalid="true"]), .persona-title-field:has(> input[aria-invalid="true"]) { --field-focus-ink: var(--vermilion); border-color: var(--vermilion); }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 3em) max-content 44px; align-items: center; gap: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.stepper > button { width: 44px; height: 44px; padding: 0; font-size: 18px; }
.stepper > button:disabled { cursor: default; }
.field .stepper > input { appearance: textfield; border: 0; text-align: center; font-variant-numeric: tabular-nums; }
.field .stepper > input:focus { box-shadow: none; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.form-error { font-size: var(--small-size); }
.form-error:empty { display: none; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-stack { gap: 16px; }
.type-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--ink); }
.type-button { padding-inline: 4px; }
.type-button + .type-button { border-inline-start: 1px solid var(--ink); }
.type-button.active { color: var(--on-vermilion); background: var(--ink); }
.templates { display: flex; flex-wrap: wrap; gap: 0 20px; }
.templates button { justify-content: start; padding-block: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; text-align: start; white-space: nowrap; }
.settings-list > * + * { border-top: 1px solid var(--rule); padding-top: 8px; }
.settings-persona { display: grid; gap: 4px; min-height: 44px; text-align: start; }
.settings-persona-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.settings-persona-value > span { font-size: 13px; color: var(--muted); }
.settings-persona:hover .settings-label { text-decoration: underline; text-underline-offset: 4px; }
.settings-danger .text-button { color: var(--vermilion); }
#dissolve-form .primary-button:disabled { cursor: default; }
.persona-intro { color: var(--muted); font-size: 14px; line-height: 1.6; }
.persona-presets { margin-top: 16px; border-top: 1px solid var(--ink); }
.persona-choice { display: flex; align-items: baseline; justify-content: space-between; width: 100%; min-height: 56px; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: start; }
.persona-choice > span:first-child { flex: none; font: 700 18px var(--serif); }
.persona-choice > span:last-child { color: var(--muted); font-size: 14px; text-align: end; }
.persona-choice[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.persona-choice[aria-pressed="true"] > span:last-child { color: inherit; }
.persona-choice:focus-visible { outline-offset: -2px; }
.persona-choice[aria-pressed="true"]:focus-visible { outline-color: var(--paper); }
.persona-custom-label { margin-top: 16px; font-size: 13px; color: var(--muted); }
.persona-fields { display: grid; grid-template-columns: minmax(0, 112px) minmax(0, 1fr); gap: 12px; margin-top: 6px; }
.persona-fields input { min-height: 44px; font-size: 15px; }
.persona-fields input::placeholder { color: var(--muted); opacity: 1; }
.persona-title-field { display: flex; align-items: center; border-bottom: 1px solid var(--rule); font: 700 18px var(--serif); }
.persona-title-field input, .persona-title-field input[aria-invalid="true"] { min-height: 43px; font: inherit; border: 0; }
.persona-title-field input:focus { box-shadow: none; }
.persona-title-field input::placeholder { font: 400 13px var(--sans); }
.persona-note { margin-top: 12px; }
.persona-sheet .primary-button:disabled { cursor: default; }
.rules-list { padding-inline-start: 24px; }
.rules-list li + li { margin-top: 8px; }
.notification-section + .notification-section { margin-top: 24px; }
.notification-section > p { margin-top: 8px; }
.activity-list { list-style: none; padding: 0; margin: 4px 0 0; }
.activity-list li { border-bottom: 1px solid var(--rule); }
.activity-link, .activity-note { width: 100%; text-align: start; padding: 8px 0; overflow-wrap: anywhere; }
.settings-dialog .activity-link { justify-content: flex-start; }
.share-preview { display: grid; place-items: center; }
.share-preview img { width: min(100%, 420px); height: auto; }
dialog.share-full .modal-body { padding-inline: 0; }
.share-full .share-preview img { width: 100%; }
.share-full .share-hint { margin-inline: 16px; }
.share-hint { margin-top: 8px; color: var(--muted); }
.wechat-share .share-hint { color: var(--ink); font-size: 15px; font-weight: 700; }
.toast { position: fixed; inset: auto auto calc(16px + var(--mobile-nav-height) + env(safe-area-inset-bottom)) 50%; translate: -50%; width: max-content; max-width: calc(100% - 24px); background: var(--ink); color: var(--on-vermilion); padding: 8px 16px; font-size: var(--label-size); white-space: pre-line; overflow-wrap: anywhere; pointer-events: none; visibility: hidden; z-index: 4; }
.activity-toast { max-width: calc(100% - 16px); padding-inline: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.visible { visibility: visible; }
.office-footer { margin-top: 48px; padding-top: 12px; border-top: 1px solid var(--rule-wall); color: var(--muted); font-size: var(--small-size); }

@media (max-width: 880px) {
  :root {
    --title-size: 22px;
    --feature-size: 28px;
    --notice-size: 24px;
    --slip-size: 18px;
    --label-size: 13px;
    --body-size: 15px;
    --data-size: 20px;
    --small-size: 12px;
    --gutter: 12px;
    --feature-padding: 22px 20px;
    --notice-padding: 18px 20px;
    --slip-padding: 14px 16px;
    --mobile-nav-height: 62px;
  }

  .topbar { gap: 8px; padding: 8px; }
  .notice-signoff { --seal-size: 52px; }
  .current-nickname, .topbar-divider, .desktop-nav { display: none; }
  .account-button { flex: none; width: 40px; padding: 0; }
  .primary-button { min-height: 52px; }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: var(--mobile-nav-height); padding-bottom: env(safe-area-inset-bottom); background: var(--wall); border-top: 1px solid var(--rule-wall); }
  .bottom-nav .nav-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; color: var(--muted); font-size: var(--small-size); }
  .bottom-nav .nav-item.active { color: var(--ink); }
  .bottom-nav .nav-badge { left: calc(50% + 8px); }
  .lobby-grid, .ranking-layout { grid-template-columns: minmax(0, 1fr); }
  .ranking-layout { gap: 20px; }
  .ranking-layout .paper { padding-inline: 18px; padding-bottom: 8px; }
  .ranking-layout .section-title .text-button { font-size: 14px; font-weight: 400; }
  .ranking-layout aside, .ranking-layout .rank-note { padding-inline: 4px; }
  .lobby-heading { min-height: 92px; padding: 0 8px 4px; }
  .lobby-heading .lobby-tagline { font-size: 14px; }
  .mascot { width: 72px; }
  .featured h2 { margin-top: 16px; line-height: 1.3; max-inline-size: 9em; text-wrap: balance; }
  .featured .description { margin-block: 4px 12px; }
  .featured .notice-circles { font-size: 18px; }
  .featured .facts { margin-top: 12px; }
  .featured .fact-names { flex-basis: 100%; }
  .facts { padding-block: 12px; gap: 8px 24px; }
  .featured-footer .primary-button { min-width: 124px; }
  .lobby-grid { grid-template-areas: none; grid-template-rows: none; }
  .lobby-grid > * { grid-area: auto; }
  .lobby-others, .lobby-rank, .my-heading { padding-inline: 8px; }
  .lobby-others .section-heading { margin-bottom: 0; }
  .featured, .todo-paper, .detail-paper { box-shadow: var(--shadow-slip); }
  .lobby-others .notice-slip, .archive-active .notice-slip { background: none; padding: 0; border-bottom: 1px solid var(--rule-wall); box-shadow: var(--shadow-none); }
  .lobby-others .row-link { display: flex; gap: 8px; padding: 8px 0; }
  .lobby-others .row-end { text-align: end; }
  .lobby-others .slip-title, .archive-active .slip-title, .wall-row .slip-title { font-size: 15px; }
  .lobby-others .row-copy .muted, .lobby-others .row-end .desktop-only { display: none; }
  .lobby-others .slip-list { gap: 0; }
  .lobby-links { padding-inline: 8px; margin-top: 8px; }
  .my-heading { padding-block: 8px; }
  .filter-bar { gap: 4px 8px; }
  .archive-section { margin-top: 24px; }
  .archive-section .section-heading, .archive-active .slip-list, .archive-section > .wall-row { margin-inline: 8px; }
  .todo-paper { gap: 4px; position: relative; }
  .todo-paper .title-button::after { content: ""; position: absolute; inset: 0; }
  .todo-paper h3 { font-size: 19px; }
  .todo-desktop { display: none; }
  .todo-mobile { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .detail-page .detail-toolbar { padding-inline: 4px; }
  .detail-action-bar .primary-button { flex: 1 0 100%; }
  .detail-actions { padding-inline: 4px; }
  .identity-brand { padding-inline: 8px; }
  .identity-page { padding-bottom: 36px; }
  .identity-extras { margin-top: 4px; }
  .identity-page:has(.welcome-intro, .join-paper) { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: 16px; }
  .join-paper > .notice-circles { font-size: 18px; }
  .join-mascot { margin-top: auto; }
  .welcome-footer { flex-direction: column; margin-top: auto; padding-top: 24px; }
  .homeless-footer { margin-top: auto; padding-top: 24px; }
  dialog { inset: var(--modal-viewport-top, 0px) 0 auto; margin: 0; width: 100%; max-width: none; height: var(--modal-viewport-height, 100dvh); max-height: none; box-shadow: var(--shadow-none); }
  #modal-content { height: 100%; }
  .modal-frame, .modal-body { flex: 1 1 auto; }
  .modal-header { display: grid; grid-template: 56px auto / 56px minmax(0, 1fr) 56px; align-items: center; gap: 0; padding: 0; }
  .modal-header::after { content: ""; grid-area: 1 / 1 / 2 / -1; align-self: end; border-bottom: 1px solid var(--rule); pointer-events: none; }
  .modal-heading { display: contents; }
  .modal-header h2 { grid-area: 1 / 2; font-size: 20px; line-height: 1.25; text-align: center; text-wrap: balance; }
  .modal-header .icon-button { grid-area: 1 / 1; justify-self: center; }
  .modal-subtitle { grid-area: 2 / 1 / 3 / -1; margin: 8px 20px 0; }
  .modal-body { padding: 16px 20px; }
  .modal-body:last-child { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .modal-body .field :is(input, textarea, select):not(.main-field) { font-size: 16px; }
  .modal-footer { margin-top: auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-footer-actions { display: grid; gap: 4px; justify-items: start; }
  .modal-footer .primary-button { width: 100%; }
  .create-cancel { display: none; }
  .templates { flex-direction: column; align-items: start; }
  .office-footer { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.participant-status.attention { color: var(--vermilion); }
.todo-paper > .primary-button { min-height: 44px; }
.confirm-strip .text-button { min-height: auto; min-width: auto; }
a:active:not(.primary-button, .outline-button), button:active:not(:disabled, .icon-button, .primary-button, .outline-button, .attention-button, .nav-item, .filter-button) { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 880px) {
  .desktop-only { display: none; }
  .brand-mark { width: 30px; }
  .todo-paper > .todo-desktop { display: none; }
  .confirm-strip > .attention { flex: none; }
}

#start-title { font-size: var(--title-size); }
.join-paper > .notice-circles { margin-bottom: 16px; }
.join-foot { margin-top: 16px; align-items: end; }
.join-help { margin-top: -12px; }
.modal-body > .rules-list + p { margin-top: 16px; }
.modal-body .wall-row { border-color: var(--rule); }
dialog .toast { bottom: max(16px, env(safe-area-inset-bottom)); }
.modal-footer > .toast { position: absolute; bottom: calc(100% + 8px); }

@media (max-width: 360px) {
  .topbar { gap: 4px; padding-inline: 0; }
  .brand-name { font-size: 15px; }
}
