:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei UI", "PingFang SC", sans-serif;
  line-height: 1.55;
  color: #142b25;
  background: #f2f6f4;
  --muted: #4b665e;
  --surface: #fff;
  --line: #d8e4dd;
  --soft: #f2f7f4;
  --accent: #136048;
  --accent-hover: #0c4c38;
  --danger: #873b32;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
h1 { font-size: clamp(1.75rem, 4vw, 2.375rem); line-height: 1.2; letter-spacing: -.025em; }
h2 { font-size: 1.125rem; line-height: 1.35; overflow-wrap: anywhere; }
button, input { font: inherit; }
code { font: .875rem ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #197c63; outline-offset: 3px; }
#dashboard-title:focus { outline: none; }

.frame { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-content { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; gap: .75rem; }
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 680; line-height: 1.25; }
.brand > span:last-child { white-space: nowrap; }
.brand-divider { display: inline-block; width: 1px; height: 1rem; margin-inline: .375rem; vertical-align: -.15rem; background: #c5d7cd; }
.brand-mark { position: relative; width: 2rem; height: 2rem; flex: none; border-radius: .625rem; background: var(--accent); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; border: 1px solid #d9f6e6; border-radius: .2rem; width: .8rem; height: .55rem; }
.brand-mark::before { top: .48rem; left: .44rem; }
.brand-mark::after { top: .83rem; left: .78rem; background: var(--accent); }

.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.login { max-width: 29rem; padding: clamp(1.25rem, 6vw, 2rem); margin: clamp(2.5rem, 11vh, 6rem) auto; box-shadow: 0 .75rem 2.5rem #173f2710; }
.login h1 { font-size: 1.75rem; }
.login > .hint { margin-top: .5rem; }
.login .form { margin-top: 1.625rem; }
.form { display: grid; gap: 1rem; }
.form label { display: block; font-weight: 650; margin-bottom: .375rem; }
.form input { width: 100%; min-height: 2.875rem; padding: .5rem .75rem; border: 1px solid #a9bdb3; border-radius: .5rem; background: var(--surface); color: inherit; }
.form .hint { margin-top: .375rem; }
.password-field { position: relative; }
.password-field input { padding-inline-end: 4.5rem; }
.password-field .button { position: absolute; right: .25rem; top: .125rem; }
.button { min-height: 2.625rem; padding: .5rem .875rem; border: 1px solid #b8cbbf; border-radius: .5rem; background: var(--surface); color: #24473b; font-weight: 650; white-space: nowrap; }
.button:hover:not(:disabled) { background: #eaf3ee; }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-plain { background: transparent; border-color: transparent; }
.button-small { font-size: .875rem; }
.actions { display: flex; gap: .625rem; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: .9375rem; }
.notice { padding: .625rem .875rem; background: #e6f3eb; color: #205740; border: 1px solid #c1decc; border-radius: .5rem; overflow-wrap: anywhere; }
.notice.is-error { background: #fff2ee; border-color: #f0d2c9; color: var(--danger); }

.dashboard { padding: clamp(1.5rem, 5vw, 3rem) 0 3rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dashboard > .notice { margin-bottom: 1rem; }
.startup { margin-top: 1.5rem; }
.workspace { display: grid; grid-template-columns: minmax(12rem, 15.5rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.people { padding: 1rem; min-width: 0; }
.people h2 { padding: .25rem .5rem .625rem; }
.people-list { display: grid; gap: .25rem; }
.person { display: flex; width: 100%; min-height: 2.875rem; gap: .75rem; align-items: center; justify-content: space-between; text-align: left; padding: .5rem .625rem; background: transparent; color: inherit; border: 1px solid transparent; border-radius: .5rem; }
.person-name { min-width: 0; overflow-wrap: anywhere; }
.person:hover { background: var(--soft); }
.person[aria-pressed="true"] { color: #124d39; background: #e1f1e7; border-color: #cee7d6; font-weight: 650; }
.person-count { color: var(--muted); font-size: .875rem; }
.detail { display: grid; gap: 1rem; min-width: 0; }
.card { padding: clamp(1rem, 3vw, 1.5rem); }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: .75rem 1.25rem; flex-wrap: wrap; }
.section-heading .hint { margin-top: .25rem; }
.member { max-width: 54rem; }
.member .detail { margin-top: 1rem; }
.dialog-copy { color: var(--muted); }
.issued-credentials { margin-block: .875rem 0; }
.settings { border-block: 1px solid var(--line); margin: 1rem 0 .75rem; }
.settings > div { display: grid; grid-template-columns: minmax(6.25rem, .25fr) minmax(0, 1fr); gap: .25rem .75rem; align-items: center; padding: .625rem 0; }
.settings > div + div { border-top: 1px solid var(--line); }
.settings dt { color: var(--muted); font-size: .9375rem; font-weight: 620; }
.settings dd { display: flex; min-width: 0; align-items: center; gap: .5rem .875rem; flex-wrap: wrap; }
.key-row dd { justify-content: space-between; }
.key-row code { user-select: all; }

.countdown { color: var(--accent); font: 650 1rem ui-monospace, Consolas, monospace; }
.waiting { display: flex; align-items: center; gap: .625rem; color: var(--muted); background: var(--soft); border-radius: .5rem; margin-top: 1rem; padding: .75rem .875rem; }
.pulse { width: .625rem; height: .625rem; flex: none; border-radius: 50%; background: #1e845f; box-shadow: 0 0 0 .2rem #d3ebdc; }
.records:not(:empty) { margin-top: .875rem; border-top: 1px solid var(--line); }
.record { display: flex; align-items: center; justify-content: space-between; gap: .625rem 1rem; flex-wrap: wrap; min-height: 3.75rem; padding: .625rem 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; padding-bottom: 0; }
.record-main { min-width: 0; display: grid; gap: .25rem; }
.record-main code { font-size: .9375rem; }
.status { display: inline-block; padding: .125rem .5rem; color: var(--muted); background: #edf2ef; font-size: .875rem; border-radius: .25rem; }
.status.is-online { color: #145640; background: #e4f4ea; }
.status.is-disabled { color: var(--danger); background: #fff0ec; }

dialog { width: min(100% - 2rem, 27rem); max-height: calc(100% - 2rem); padding: 1.5rem; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: .875rem; box-shadow: 0 1rem 4rem #17372c2b; }
dialog::backdrop { background: #102d24a0; }
.dialog-actions { justify-content: flex-end; }

@media (max-width: 46rem) {
  .frame { width: calc(100% - 2rem); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .people-list { display: flex; flex-wrap: wrap; }
  .person { flex: 1; }
  .people-list li { display: flex; min-width: 0; max-width: 100%; }
}

@media (max-width: 25rem) {
  .topbar-content { gap: .375rem; }
  .brand { gap: .5rem; font-size: .9375rem; }
  .brand-divider { margin-inline: .125rem; }
  .topbar .button { padding-inline: .375rem; font-size: .875rem; }
  .settings > div { grid-template-columns: minmax(0, 1fr); }
}
