:root {
  color-scheme: light;
  --canvas: #f2f5fa;
  --surface: #fff;
  --ink: #162439;
  --muted: #4c5d75;
  --line: #d7e0ed;
  --brand: #2149aa;
  --selection: #ecf2ff;
  --summary: #132a50;
  --summary-text: #d3e1f7;
  --success: #22634a;
  --attention: #85520b;
  --danger: #a13537;
  --heading: "Instrument Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --body: "Source Sans 3", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 var(--body); }
h1, h2, h3 { margin: 0; font-family: var(--heading); line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(28px, 4vw, 38px); }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p, dl, dd { margin: 0; }
code { color: inherit; font: 14px var(--mono); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.subtle { color: var(--muted); }
.wrap { width: min(1120px, calc(100% - clamp(32px, 7vw, 80px))); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-content { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .account { display: flex; align-items: center; gap: 12px; }
.brand { font: 700 18px var(--heading); }
.mark { display: inline-block; position: relative; border: 1px solid var(--brand); color: var(--brand); width: 28px; height: 28px; border-radius: 8px; }
.mark::before, .mark::after { content: ""; position: absolute; top: 8px; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 2px; }
.mark::before { left: 5px; }
.mark::after { right: 5px; }
main { padding-block: clamp(26px, 5vw, 54px); }
.notice { padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--selection); }
.notice.error { color: var(--danger); background: #fff2f2; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel, .summary { min-width: 0; padding: 19px; border-radius: 14px; }
.panel { border: 1px solid var(--line); background: var(--surface); }
.panel > p, .detail-heading > p, #draft > p { margin-top: 8px; }
.sign-in { margin-inline: auto; width: min(100%, 460px); padding: clamp(20px, 5vw, 30px); }
.account-form { display: grid; gap: 8px; margin-top: 18px; }
.account-form label + input { margin-bottom: 8px; }
.account-form > button { justify-self: start; }
.sign-in form > button { width: 100%; }
.invite-email { border: 1px solid var(--line); border-radius: 8px; background: var(--selection); padding: 8px 12px; }
.invite-email dt { color: var(--muted); font-size: 13px; }
.invite-email dd { font-weight: 650; overflow-wrap: anywhere; }
#activate-expires, #password-rules { margin: 0 0 8px; font-size: 13px; }
.activation-actions { margin-top: 12px; }
label { font-weight: 650; }
input:not([type="checkbox"]), select {
  min-height: 44px; width: 100%; min-width: 0; padding: 8px 12px; border: 1px solid #8797af;
  border-radius: 8px; color: var(--ink); background: var(--surface);
}
.button { display: inline-block; min-height: 44px; padding: 8px 15px; border: 1px solid #8797af; border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 650; }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.button.primary:hover:not(:disabled) { background: #193d96; }
.button.secondary:hover:not(:disabled) { background: var(--selection); }
.button.danger { color: var(--danger); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 225px) minmax(0, 1fr); gap: 22px; align-items: start; }
.inbox h2 { font-size: 17px; margin-bottom: 12px; }
#match-list { display: grid; gap: 6px; }
.match-link {
  width: 100%; min-height: 48px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px;
  background: var(--surface); color: var(--ink); text-align: left; overflow-wrap: anywhere;
}
.match-link:hover, .match-link[aria-current="true"] { background: var(--selection); border-color: var(--line); }
.match-link span { display: block; font-size: 13px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 16px; align-items: start; margin-top: 15px; }
.full-span { grid-column: 1 / -1; }
.fields > label:first-child { display: block; margin-bottom: 7px; }
.option { display: flex; align-items: start; gap: 10px; margin-top: 16px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.option:has(:checked) { background: var(--selection); border-color: var(--brand); }
.option:has(:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.option input { accent-color: var(--brand); margin: 3px 0 0; inline-size: 17px; block-size: 17px; flex: none; }
.option span span { display: block; margin-top: 3px; font-weight: 400; font-size: 14px; }
.summary { color: #fff; background: var(--summary); }
.summary dt { margin-top: 11px; color: var(--summary-text); font-size: 13px; }
.summary dd { margin-top: 1px; overflow-wrap: anywhere; }
.people { margin-top: 9px; }
.people div { display: flex; justify-content: space-between; gap: 8px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.people dt { overflow-wrap: anywhere; }
.people dd { flex: none; font-weight: 650; color: var(--attention); }
.people dd.ready { color: var(--success); }
.actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 8px; }
#account-invite-form { max-width: 520px; }
.invitation-history { margin-top: 24px; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
#invitation-list-status:not(:empty) { margin-top: 8px; }
#invitation-list { padding: 0; margin: 10px 0 0; list-style: none; }
#invitation-list li { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.invitation-row-details { min-width: 0; overflow-wrap: anywhere; }
.invitation-row-details p { font-size: 13px; }
.invitation-state.pending { color: var(--attention); }
.invitation-state.accepted { color: var(--success); }
.local-host { margin-top: 16px; }
.local-host iframe { display: block; height: 620px; width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
@media (max-width: 860px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); }
}
@media (max-width: 600px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .account { gap: 6px; }
  .panel, .summary { padding: 15px; }
  .local-host iframe { height: 700px; }
}
