[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--dh-page); color: var(--dh-ink); font: var(--dh-w-body) var(--dh-fs-body)/var(--dh-lh-body) var(--dh-font); }
code, .fp, pre { font-family: var(--dh-mono); font-size: 0.86em; }
code { overflow-wrap: anywhere; }
pre { margin: 8px 0 0; padding: 12px; overflow: auto; max-height: 360px; background: var(--dh-sunken); border-radius: var(--dh-r2); white-space: pre-wrap; word-break: break-all; font-size: 12.5px; }
.muted { color: var(--dh-ink-2); }
.wrap { word-break: break-all; }
.note { margin: 10px 0 0; color: var(--dh-ink-2); font-size: var(--dh-fs-sm); }
.lede, .step__lede { margin: 0 0 20px; max-width: 64ch; color: var(--dh-ink-2); font-size: var(--dh-fs-lead); line-height: 1.45; }
p { max-width: 70ch; }
.file { position: relative; cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; width: 1px; height: 1px; }

#app { width: 100%; max-width: var(--dh-max); margin: 0 auto; padding: 28px var(--dh-gutter) 64px; }

.group { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--dh-line); }
.group__name { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: var(--dh-lh-head); font-weight: var(--dh-w-head); font-stretch: var(--dh-stretch-head); }
.group__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; color: var(--dh-ink-2); font-size: var(--dh-fs-sm); }
.group__actions { display: flex; gap: 8px; align-items: center; }

.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; padding: 6px; background: var(--dh-surface); border-radius: var(--dh-r2); box-shadow: var(--dh-shadow-pop); display: grid; }
.more__menu > * { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px; background: none; color: var(--dh-ink); font: inherit; font-size: var(--dh-fs-ui); text-align: left; cursor: pointer; }
.more__menu > *:hover, .more__menu > *:focus-visible { background: var(--dh-hover); }

.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 40px; align-items: start; }
.stage { min-width: 0; max-width: 780px; overflow-wrap: anywhere; }

.rail ol { list-style: none; margin: 0; padding: 0; position: sticky; top: 88px; }
.rail__step button { display: flex; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--dh-r2); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rail__step button:hover { background: var(--dh-hover); }
.rail__step[aria-current] button { background: var(--dh-surface); box-shadow: 0 0 0 1px var(--dh-line); }
.rail__mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--dh-line-2, var(--dh-line)); color: var(--dh-ink-2); font-size: var(--dh-fs-sm); font-weight: var(--dh-w-strong); }
.rail__step--done .rail__mark { border-color: var(--dh-brand); background: var(--dh-brand); color: #fff; }
.rail__step--now .rail__mark { border-color: var(--dh-brand); color: var(--dh-brand-ink); box-shadow: 0 0 0 3px var(--dh-brand-soft); }
.rail__text { display: grid; gap: 1px; min-width: 0; }
.rail__title { font-weight: var(--dh-w-strong); }
.rail__note { color: var(--dh-ink-2); font-size: var(--dh-fs-sm); overflow-wrap: anywhere; }
.rail__step--todo .rail__title { color: var(--dh-ink-2); }

.step__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.step__title { margin: 0 0 8px; font-size: 24px; line-height: var(--dh-lh-head); font-weight: var(--dh-w-head); }
.step__head .step__title { margin: 0; }
.step__head + .step__lede { margin-top: 8px; }

.panel { margin: 0 0 16px; padding: 20px; background: var(--dh-surface); border: 1px solid var(--dh-line); border-radius: var(--dh-r3, 10px); }
.panel__title { margin: 0 0 12px; font-size: 17px; font-weight: var(--dh-w-strong); }
.panel .dh-field { margin-bottom: 14px; }
.panel > .dh-actions { margin-top: 6px; }

.empty { padding: 28px 24px; border: 1.5px dashed var(--dh-line); border-radius: var(--dh-r3, 10px); }
.empty__title { margin: 0 0 4px; font-size: 18px; font-weight: var(--dh-w-strong); }
.empty p { margin: 0 0 12px; color: var(--dh-ink-2); }
.empty .empty__title { color: var(--dh-ink); }
.invite code { display: inline-block; margin-top: 4px; padding: 6px 10px; background: var(--dh-sunken); border-radius: 6px; }

.waiting { display: flex; gap: 12px; align-items: center; margin: 4px 0 16px; padding: 14px 16px; background: var(--dh-brand-soft); border-radius: var(--dh-r2); }
.waiting p { margin: 0; }

/* The quorum: one seat per member, filled as they act; the rule underneath counts against the threshold. */
.quorum { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 8px 0 6px; padding: 0; }
.seat { display: grid; justify-items: center; gap: 4px; width: 92px; text-align: center; }
.seat__disc { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 2px dashed var(--dh-line); color: var(--dh-ink-2); font-size: 19px; font-weight: var(--dh-w-head); background: var(--dh-surface); }
.seat--on .seat__disc { border: 2px solid var(--dh-brand); background: var(--dh-brand); color: #fff; }
.seat--me .seat__disc { box-shadow: 0 0 0 3px var(--dh-page), 0 0 0 5px var(--dh-act); }
.seat__name { font-weight: var(--dh-w-ui); overflow-wrap: anywhere; line-height: 1.25; }
.seat__you { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--dh-chip); color: var(--dh-ink-2); font-size: var(--dh-fs-xs); font-weight: var(--dh-w-ui); }
.seat__state { min-height: 1.2em; color: var(--dh-ink-2); font-size: var(--dh-fs-xs); }
.quorum__rule { margin: 0 0 16px; color: var(--dh-ink-2); font-size: var(--dh-fs-sm); }
.quorum__count { color: var(--dh-ink); font-weight: var(--dh-w-strong); }

.people { list-style: none; margin: 16px 0; padding: 0; border-top: 1px solid var(--dh-line); }
.person { display: grid; grid-template-columns: 40px minmax(90px, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--dh-line); }
.people--compact .person { grid-template-columns: minmax(80px, 1fr) auto auto; }
.person .seat__disc { width: 36px; height: 36px; font-size: 15px; border-style: solid; }
.person--me .seat__disc { border-color: var(--dh-act); }
.person__name { font-weight: var(--dh-w-ui); overflow-wrap: anywhere; }
.fp { white-space: nowrap; letter-spacing: .02em; }
.person__check { color: var(--dh-ink-2); font-size: var(--dh-fs-sm); justify-self: end; }

.picks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.threshold { display: flex; align-items: center; gap: 10px; }
.threshold .dh-input { width: 84px; }

.proposal { margin: 0 0 14px; padding: 18px 20px; background: var(--dh-surface); border: 1px solid var(--dh-line); border-radius: var(--dh-r3, 10px); }
.proposal--focus { border-color: var(--dh-brand); }
.proposal__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.proposal__title { margin: 0; font-size: 17px; font-weight: var(--dh-w-strong); }
.proposal__meta { margin: 4px 0 10px; color: var(--dh-ink-2); font-size: var(--dh-fs-sm); }
.proposal__summary { margin: 0 0 12px; padding: 0; list-style: none; overflow-wrap: anywhere; }
.proposal__summary li { white-space: pre-wrap; }
.proposal .quorum .seat { width: 76px; }
.proposal .seat__disc { width: 40px; height: 40px; font-size: 15px; }
.group-title { margin: 28px 0 10px; font-size: var(--dh-fs-ui); font-weight: var(--dh-w-strong); color: var(--dh-ink-2); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--dh-chip); text-align: center; font-size: var(--dh-fs-xs); }
.kinds { margin-bottom: 16px; }
.panel--new { border-color: var(--dh-brand); }

.keys code { white-space: nowrap; }
.keys .is-off td { color: var(--dh-ink-3); }
.dh-disclosure { margin: 12px 0; }
.dh-notice { margin: 12px 0; overflow-wrap: anywhere; }
.address code { font-size: 14px; }

.start__intro { margin-bottom: 20px; }
.start__title { margin: 0 0 8px; font-size: clamp(28px, 3.4vw, 38px); line-height: var(--dh-lh-head); font-weight: var(--dh-w-head); font-stretch: var(--dh-stretch-head); }
.start__paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 900px; }
.start__paths--invited { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.start__paths--invited #form-create-room { display: none; }
.panel--path { display: flex; flex-direction: column; margin: 0; }
.panel--path > button { align-self: flex-start; margin-top: auto; }
.start__resume { margin: 16px 0 0; color: var(--dh-ink-2); font-size: var(--dh-fs-sm); }

#dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--dh-r3, 12px); background: var(--dh-surface); color: var(--dh-ink); box-shadow: var(--dh-shadow-pop); overflow: auto; overflow-wrap: anywhere; }
#dialog::backdrop { background: rgba(6, 18, 28, .5); }
.dlg { padding: 24px; }
.dlg__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.dlg__title { margin: 0; font-size: 21px; font-weight: var(--dh-w-head); }
.dlg__lede { margin: 0 0 14px; color: var(--dh-ink-2); }
.dlg__foot { margin-top: 20px; }
.reject { margin-top: 16px; }

.toast { position: fixed; left: 50%; bottom: calc(20px + var(--dh-tabs-h, 0px)); transform: translateX(-50%); z-index: 50; width: max-content; max-width: min(620px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--dh-r2); background: var(--dh-plate); color: var(--dh-plate-ink); box-shadow: var(--dh-shadow-pop); font-size: var(--dh-fs-ui); }
.toast--bad { background: var(--dh-bad); color: #fff; }
.toast--busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .toast--busy::before { animation: none; } }
body.is-busy .dh-btn--primary { opacity: .7; pointer-events: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .rail ol { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--dh-line); }
  .rail__step button { flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; text-align: center; }
  .rail__note { display: none; }
  .rail__title { font-size: var(--dh-fs-xs); }
  .rail__step[aria-current] button { box-shadow: inset 0 -2px 0 var(--dh-brand); background: none; border-radius: 0; }
  .start__paths { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  #app { padding-top: 20px; }
  .group { align-items: flex-start; }
  .group__actions { width: 100%; }
  .group__actions > .dh-btn { flex: 1; }
  .person { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .person .fp { grid-column: 2 / -1; grid-row: 2; white-space: normal; font-size: 12.5px; }
  .people--compact .person { grid-template-columns: minmax(0, 1fr) auto; }
  .people--compact .person .fp { grid-column: 1 / -1; }
  .panel, .proposal { padding: 16px; }
  .dlg { padding: 18px; }
  .seat { width: 76px; }
}
.local-head { max-width: var(--dh-max); margin: 0 auto; padding: 14px var(--dh-gutter); border-bottom: 1px solid var(--dh-line); }
.netcheck { margin-top: 28px; }
.readonly { border-left: 4px solid var(--dh-act); }

.facts { margin: 0 0 12px; }
.facts dd { overflow-wrap: anywhere; }
@media (min-width: 861px) { .toast { left: auto; right: 24px; transform: none; } }
@media (max-width: 860px) { .toast { top: 64px; bottom: auto; } }
.checks { margin: 0 0 12px; padding: 12px 16px; border-radius: var(--dh-r2); background: var(--dh-good-soft); }
.checks p { margin: 0 0 4px; }
.checks ul { margin: 0; padding-left: 18px; }
.keys td { overflow-wrap: normal; word-break: normal; }

.confirm { margin: 0 0 12px; padding: 12px 16px; border-left: 4px solid var(--dh-act); background: var(--dh-sunken); border-radius: 6px; }
.done-row { margin: 0 0 8px; border: 1px solid var(--dh-line); border-radius: var(--dh-r2); background: var(--dh-surface); }
.done-row > summary { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; }
.done-row > summary::-webkit-details-marker { display: none; }
.done-row__title { font-weight: var(--dh-w-strong); }
.done-row > .proposal { margin: 0; border: 0; border-top: 1px solid var(--dh-line); border-radius: 0; }
@media (max-width: 600px) {
  #dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .dlg { padding-bottom: 0; }
  .dlg__foot { position: sticky; bottom: 0; margin: 16px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--dh-surface); border-top: 1px solid var(--dh-line); }
  .toast { top: auto; bottom: 16px; }
  .group__actions { width: auto; }
  .group { flex-wrap: nowrap; align-items: flex-start; }
}
