:root {
  --ground: #f3f5f4;
  --surface: #ffffff;
  --text: #17221d;
  --muted: #59675f;
  --line: #d8e0da;
  --accent: #087c47;
  --accent-hover: #056137;
  --accent-soft: #e9f4ed;
  --error: #a42b35;
  --error-soft: #fff1f2;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--ground);
  font-size: 16px;
  line-height: 1.6;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button, input, output { caret-color: var(--accent); }
::selection { background: #c4e7d3; color: var(--text); }
button { min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; transition: background-color 160ms ease-out, border-color 160ms ease-out; }
button:hover { background: var(--ground); border-color: #a2b6a9; }
button:active { background: #e1e9e4; }
button.primary { color: white; border-color: var(--accent); background: var(--accent); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled, button.danger:disabled { cursor: not-allowed; color: #66746b; background: #e8ece9; border-color: #d1d9d4; }
button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
button.quiet:hover { background: var(--ground); color: var(--text); }
button.danger { color: var(--error); }
button.danger:hover { border-color: var(--error); background: var(--error-soft); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
input { width: 100%; min-height: 46px; padding: 9px 12px; background: white; color: var(--text); border: 1px solid #acbab1; border-radius: 8px; }
input::placeholder { color: var(--muted); }
input:focus { border-color: var(--accent); }
input[type="number"] { font-variant-numeric: tabular-nums; }
label { display: block; margin-bottom: 7px; font-size: 0.9375rem; font-weight: 600; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.3; font-weight: 650; }
h2 { font-size: 1.25rem; line-height: 1.4; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
.shell { width: min(100% - 48px, 1060px); margin: 44px auto; }
.page-header, .account, .section-heading, .list-heading, .copy-row { display: flex; align-items: center; gap: 12px; }
.page-header, .section-heading, .list-heading { justify-content: space-between; }
.account { font-size: 0.9375rem; }
.status { min-height: 36px; padding-block: 7px; font-size: 0.9375rem; color: var(--muted); }
.status.error { color: var(--error); }
.login { max-width: 420px; margin: 48px auto 72px; background: var(--surface); border-radius: 14px; padding: 32px; }
.login h2 { margin-bottom: 24px; }
.login form { display: flex; flex-direction: column; }
.login input { margin-bottom: 20px; }
.login button { margin-top: 4px; }
.tabs { display: flex; gap: 8px; padding: 8px; background: #e9eeeb; border-radius: 12px; margin: 8px 0 28px; width: fit-content; }
.tabs button { min-width: 104px; border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); }
.tabs button:hover { color: var(--accent); }
[role="tabpanel"] { background: var(--surface); border-radius: 14px; padding: 28px 32px; }
.section-heading { align-items: flex-start; margin-bottom: 24px; }
.section-heading > button { flex-shrink: 0; white-space: nowrap; }
.section-heading p { margin-top: 8px; max-width: 70ch; color: var(--muted); font-size: 0.9375rem; }
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 16px; align-items: end; }
.invite-form button { min-height: 46px; }
.muted { color: var(--muted); font-weight: 400; }
label .muted { margin-left: 6px; font-size: 0.8125rem; }
.new-invite { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 24px; align-items: center; padding: 24px 0; margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.new-invite p { color: var(--muted); font-size: 0.875rem; margin-top: 6px; }
.new-invite output { display: block; margin: 14px 0; font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; user-select: all; }
.new-invite img { width: 160px; height: 160px; }
.copy-row { flex-wrap: wrap; }
#copy-status { font-size: 0.875rem; color: var(--accent); }
.list-heading { margin-top: 32px; margin-bottom: 8px; }
.record-list { min-width: 0; }
.record { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.record-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.record-title strong { overflow-wrap: anywhere; }
.record-details { display: flex; flex-wrap: wrap; gap: 4px 24px; color: var(--muted); font-size: 0.875rem; margin-top: 8px; font-variant-numeric: tabular-nums; }
.record-details span { overflow-wrap: anywhere; }
.record-details .fingerprint { flex-basis: 100%; font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 0.8125rem; overflow-wrap: anywhere; }
.record-actions { display: flex; align-items: flex-start; gap: 8px; }
.state { display: inline-block; padding: 2px 8px; font-size: 0.8125rem; color: var(--muted); background: var(--ground); border-radius: 6px; white-space: nowrap; }
.state.available, .state.active { color: #056137; background: var(--accent-soft); }
.empty { padding: 28px 0; color: var(--muted); font-size: 0.9375rem; }
.password-form { grid-column: 1 / -1; padding-top: 4px; }
.password-form form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 12px; }
.password-form .field { flex: 1 1 220px; }
.password-form summary { color: var(--muted); cursor: pointer; width: fit-content; min-height: 36px; padding-block: 6px; font-size: 0.875rem; }
.password-form p { color: var(--muted); font-size: 0.875rem; }
footer { margin-top: 28px; color: var(--muted); font-size: 0.8125rem; }
@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); margin: 24px auto; }
  h1 { font-size: 1.5rem; }
  .page-header { align-items: flex-start; }
  .tabs { width: 100%; gap: 4px; }
  .tabs button { min-width: 0; flex: 1; padding-inline: 10px; }
  [role="tabpanel"] { padding: 22px 18px; }
  .section-heading { gap: 8px; }
  .invite-form { grid-template-columns: minmax(0, 1fr) 96px; gap: 16px 12px; }
  .invite-form button { grid-column: 1 / -1; }
  .new-invite { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .record { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .record-actions { flex-wrap: wrap; }
  .login { padding: 24px; margin-top: 24px; }
  .account { gap: 4px; }
  .password-form form button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

footer a { color: inherit; text-underline-offset: 3px; }
