:root {
  color-scheme: light;
  --ink: #20253a;
  --ink-light: #42495d;
  --muted: #60697e;
  --paper: #f5f6fa;
  --surface: #fff;
  --line: #e0e3eb;
  --accent: #5145d8;
  --accent-ink: #4136b4;
  --accent-soft: #efedff;
  --green: #1b755e;
  --side-width: 214px;
  --radius: 12px;
  --font: "Segoe UI Variable Text","Segoe UI","PingFang SC","Noto Sans SC","Microsoft YaHei UI","Microsoft YaHei",sans-serif;
  --mono: "Cascadia Mono",Consolas,ui-monospace,monospace;
  font: 14px/1.55 var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
*,*::before,*::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; }
button,input,select,textarea { font: inherit; color: inherit; }
button { border: 0; background: transparent; }
button,select { cursor: pointer; }
button:disabled,input:disabled,select:disabled { opacity: .55; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button,select,a,input[type="checkbox"] { -webkit-tap-highlight-color: transparent; }
:where(a,button,select,input,textarea):focus-visible { outline: 3px solid #7a70f1; outline-offset: 3px; }
[hidden] { display: none !important; }
h1,h2,h3,h4,p,ol,ul,dl { margin: 0; }
h1,h2,h3,h4 { line-height: 1.35; }
p { line-height: 1.65; }
.icon { flex: none; width: 18px; height: 18px; vertical-align: middle; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 50; color: white; background: var(--accent); border-radius: 8px; padding: 10px 15px; }
.skip-link:focus { top: 12px; }

/* Application navigation */
.layout { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 8; width: var(--side-width); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior:contain; background: var(--surface); border-right:1px solid var(--line); }
.sidebar-brand { min-height: 78px; display: flex; align-items: center; padding: 0 22px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; width: max-content; }
.wordmark img { width: 35px; height: 35px; border-radius: 9px; }
.wordmark-type { display: grid; gap: 3px; line-height: 1; }
.wordmark-type b { color:#202034; font-size:21px; font-weight:780; letter-spacing:-.9px; }
.wordmark-type small { font-size:10px; letter-spacing:.15em; color:var(--muted); }
.primary-menu { flex: 1; padding: 15px 13px; }
.nav-group + .nav-group { margin-top: 23px; }
.nav-label { margin:0 13px 8px; color:#71798c; font-size:11px; font-weight:570;letter-spacing:.11em; }
.nav-item { display:flex;align-items:center;gap:11px;margin:2px 0;min-height:39px;padding:7px 12px;border-radius:7px;font-size:14px;font-weight:500;color:#444c60; }
.nav-item > .icon { width:17px;height:17px;color:#657086; }
.nav-item:hover { background:#f4f5f9;color:var(--ink); }
.nav-item.active { background:var(--accent-soft);color:var(--accent-ink);font-weight:670; }
.nav-item.active > .icon { color:var(--accent); }
.nav-lock { margin-left: auto; display: inline-flex; color: #81899a; }
.nav-lock .icon { height: 13px; width: 13px; }
.sidebar-bottom { padding: 8px 13px 16px; }
.sidebar-bottom > .nav-item { min-height:34px; }
.side-profile { display:flex;align-items:center;gap:10px;margin-top:10px;padding:14px 4px 0;border-top:1px solid var(--line); }
.profile-icon { width:34px;height:34px;flex:none;display:grid;place-items:center;border-radius:50%;color:#544ab0;background:#eeedfc; }
.account-info { display: grid; gap: 2px; min-width: 0; text-align: left; padding: 0; }
.account-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-info small { font-size:11px;color:var(--muted); }
.icon-btn,.top-help { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; color: var(--muted); flex: none; }
.icon-btn:hover,.top-help:hover { background: #f0f1f7; color: var(--accent); }
.skin-plain { width: 28px; margin-left: auto; }
.mobile-close,.menu-button,.scrim { display: none; }
.workspace { min-height: 100vh; margin-left: var(--side-width); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 0 clamp(21px,2.35vw,42px); background: var(--surface); border-bottom: 1px solid var(--line); }
.crumb,.top-actions { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.crumb { gap: 9px; font-size: 13px; color: var(--muted); }
.crumb-root:hover { color: var(--accent); }
.crumb strong { color: var(--ink); font-weight: 590; }
.crumb-split .icon { width: 12px; height: 12px; color: #969daf; }
.demo-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #566477; white-space: nowrap; }
.demo-status i { width: 7px; height: 7px; border-radius: 50%; background: #238267; }
.main-content { max-width: 1650px; margin: 0 auto; padding: 24px clamp(21px,2.35vw,42px) 42px; outline: none; }

/* Shared components */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: max-content; max-width: 100%; min-height: 36px; padding: 7px 13px; color: #343b50; background: var(--surface); border: 1px solid #ccd2df; border-radius: 7px; font-size: 13px; font-weight: 555; line-height: 1.45; text-align: center; }
.btn:hover { color:var(--accent-ink);border-color:#a79fea;background:#f7f6ff; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 15px; height: 15px; }
.btn.primary,.primary.btn { color: #fff; background: var(--accent); border-color: var(--accent); font-weight: 620; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.btn.danger-outline { color: #a13b40; border-color: #e3bec2; }
.btn.fill { width: 100%; }
.switch-btn { min-height: 32px; padding: 5px 11px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 3px 0 21px; }
.section-head h1 { font-size: clamp(26px,2.35vw,34px); font-weight: 710; letter-spacing: -.035em; }
.section-head p { margin-top: 5px; color: var(--muted); }
.panel h2,.subsection h2 { font-size: 18px; letter-spacing: -.025em; font-weight: 655; }
.muted { color: var(--muted); }
.tag { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; width: max-content; padding: 3px 8px; border-radius: 5px; background: #edf0f6; color: #515c70; font-size: 12px; font-weight: 540; white-space: nowrap; line-height: 1.45; }
.tag.positive { background: #e5f4ee; color: #1c6953; }
.tag.amber { background: #fff2d9; color: #83571e; }
.tag.negative { background: #fbebed; color: #9a434a; }
.action-row,.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.form-actions { justify-content: flex-end; margin-top: 5px; }
.form-panel { padding: 23px 25px; }
.form-panel > h2,.subsection > h2 { margin-bottom: 16px; }
.form-panel .form-actions { margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); }
.subsection,.divided { margin-top: 21px; padding-top: 19px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; font-size: 13px; font-weight: 570; }
.field input,.field select,.field textarea { display: block; width: 100%; max-width: 100%; min-height: 39px; padding: 8px 10px; color: var(--ink); background: white; border: 1px solid #cbd0dd; border-radius: 7px; font-weight: 430; line-height: 1.5; }
.field textarea { resize: vertical; }
.field input[readonly] { background: #f5f6fa; color: var(--muted); }
.field input::placeholder,.field textarea::placeholder { color: #787f90; }
.field small { color: var(--muted); font-size: 12px; font-weight: 400; }
.field .required { color: #ad414d; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 18px; }
.form-grid .wide,.wide { grid-column: 1/-1; }
.stack-form,.access-form { display: grid; gap: 15px; }
.form-error { margin: 8px 0 0; color: #953640; background: #fff0f1; border: 1px solid #edc5c9; border-radius: 7px; padding: 8px 11px; font-size: 13px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.empty-state { display: flex; align-items: center; flex-direction: column; gap: 7px; padding: 44px 18px; color: var(--muted); text-align: center; }
.empty-icon,.round-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 11px; color: #6558bf; background: #eeedfb; }
.empty-icon { margin-bottom: 5px; }
.empty-icon .icon { width: 22px; height: 22px; }
.empty-state h3 { color: var(--ink); font-size: 16px; }
.empty-state p { font-size: 13px; }
.empty-state .btn { margin-top: 8px; }
.boot-failed { margin: 14vh auto; max-width: 600px; }
.live-notice { position: fixed; z-index: 30; bottom: 21px; left: calc(50% + var(--side-width) / 2); transform: translate(-50%,10px); max-width: min(520px,90vw); padding: 10px 17px; border-radius: 8px; background: #28273e; color: #fff; box-shadow: 0 4px 16px #171a342a; opacity: 0; transition: opacity .15s,transform .15s; pointer-events: none; }
.live-notice.shown { opacity: 1; transform: translate(-50%,0); }

/* Identity, registration and records */
.modal { width: min(520px,calc(100vw - 24px)); max-height: min(86vh,780px); padding: 0; border: 1px solid #d7dae6; border-radius: 14px; background: white; color: var(--ink); box-shadow: 0 25px 90px #16183342; }
.modal::backdrop { background: #191b395b; backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 21px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin-top: 2px; font-size: 22px; letter-spacing: -.035em; }
.modal-head p,.access-intro,.modal-copy { color: var(--muted); font-size: 13px; }
.modal-head p { margin-top: 3px; }
.modal-head .icon-btn { margin: -3px -4px 0 0; }
.modal-body { padding: 19px 22px 22px; }
.access-modal { width: min(560px,calc(100vw - 24px)); }
.access-tabs,.tabs-line { display: flex; }
.access-tabs { padding: 3px; gap: 3px; background: #f0f1f7; border-radius: 9px; }
.access-tabs button { flex: 1; min-height: 34px; border-radius: 7px; color: var(--muted); }
.access-tabs button[aria-selected="true"] { background: #fff; color: var(--accent-ink); font-weight: 640; box-shadow: 0 1px 4px #2825421c; }
.access-body { margin-top: 18px; }
.access-intro { margin-bottom: 13px; }
.account-list-heading { margin: 0 0 8px; color: var(--ink-light); font-size: 13px; font-weight: 640; }
.role-picker { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-bottom: 14px; }
.role-choice { min-height: 60px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 8px 2px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.role-choice.selected { color:var(--accent-ink);background:#f3f1ff;border-color:#a7a0ed;font-weight:620; }
.demo-accounts,.invite-list { display: grid; gap: 7px; }
.demo-account { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; }
.demo-account:hover { border-color:#b4adee;background:#f9f9ff; }
.demo-avatar,.sender-icon,.roster-avatar { display: grid; place-items: center; width: 35px; height: 35px; flex: none; overflow: hidden; border-radius: 9px; color:#5147ad; background:#efedfb; font-weight: 680; }
.account-copy,.roster-item .grow { display: grid; gap: 2px; flex: 1; min-width: 0; }
.account-copy small,.account-open,.roster-item small,.line-top small,.profile-status small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-open { display: inline-flex; align-items: center; gap: 6px; }
.account-open .icon { width: 15px; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.profile-status,.notice { display: flex; align-items: center; gap: 12px; padding: 16px 20px; margin-bottom: 15px; }
.profile-status h2 { margin-bottom: 2px; }
.notice { background: #fff7e7; border: 1px solid #eddbb8; border-radius: var(--radius); font-size: 13px; }
.notice .btn { margin-left: auto; }
.review-note { margin-top: 3px; }
.panel-toolbar { padding: 15px 19px; border-bottom: 1px solid var(--line); }
.tabs-line { flex-wrap: wrap; gap: 5px; }
.tabs-line button { padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.tabs-line button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 620; }
.tabs-line button span { font-size: 12px; }
.identity-table-scroll { overflow-x: auto; }
.identity-table { width: 100%; min-width: 590px; border-collapse: collapse; }
.identity-table th,.identity-table td { padding: 12px 18px; text-align: left; }
.identity-table th { color: var(--muted); background: #f7f8fb; font-size: 12px; font-weight: 560; }
.identity-table td { border-top: 1px solid #eceef4; font-size: 14px; }
.identity-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 17px; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.text-link,.link-button { color: var(--accent-ink); }
.text-link .icon { width: 14px; height: 14px; }
.roster-panel { margin-bottom: 17px; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 10px; padding: 16px; }
.roster-item,.line-top { display: flex; align-items: center; gap: 11px; }
.roster-avatar { border-radius: 50%; }
.roster-avatar img { width: 100%; height: 100%; object-fit: cover; }
.inline-count { color: var(--muted); font-size: 12px; font-weight: 500; }
.relationship-list { display: grid; }
.relationship-item { padding: 17px 20px; }
.relationship-item + .relationship-item { border-top: 1px solid var(--line); }
.line-top h3 { font-size: 15px; }
.relationship-item p { margin: 10px 0 0 46px; color: var(--ink-light); white-space: pre-wrap; overflow-wrap: anywhere; }
.relationship-item .action-row { margin: 12px 0 0 46px; }
.relationship-item .relationship-hint { color: var(--muted); font-size: 12px; }
.relationship-item .contact-exchange { color: #236752; font-size: 13px; }
.sender-icon { background: #e9f3f3; color: #367772; }
@media (min-width:761px) and (max-width:1100px) {
  :root { --side-width: 182px; }
  .sidebar-brand { padding-left: 16px; }
  .primary-menu { padding-left: 9px; padding-right: 9px; }
}
@media (max-width:760px) {
  :root { --side-width: 0px; }
  .sidebar { width: 249px; max-width: 85vw; visibility: hidden; transform: translateX(-104%); transition: transform .18s ease; }
  .menu-open .sidebar { visibility: visible; transform: translateX(0); }
  .scrim { position: fixed; inset: 0; z-index: 7; background: #21233766; }
  .menu-open .scrim { display: block; }
  .mobile-close,.menu-button { display: inline-flex; }
  .mobile-close { margin-left: auto; }
  .sidebar-brand { min-height: 71px; }
  .topbar { min-height: 54px; padding: 0 14px; }
  .crumb { gap: 6px; }
  .menu-button { margin-left: -5px; }
  .top-actions { gap: 7px; }
  .main-content { padding: 16px 14px 32px; }
  .section-head { margin: 2px 0 16px; }
  .section-head p { font-size: 13px; }
  .form-panel,.modal-body { padding: 16px; }
  .panel-toolbar { padding: 13px 14px; }
  .modal { max-height: 90dvh; }
}
@media (max-width:470px) {
  .demo-status,.top-help,.crumb-root,.crumb-split { display: none; }
  .modal-head { padding: 16px 16px 12px; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .role-picker { gap: 4px; }
  .role-choice { font-size: 12px; }
  .profile-status,.notice { padding: 12px; }
  .notice { align-items: flex-start; flex-wrap: wrap; }
  .relationship-item { padding: 14px; }
  .relationship-item p,.relationship-item .action-row { margin-left: 0; }
}
@media (prefers-reduced-motion:no-preference) {
  @keyframes workspace-enter { from { opacity:.76; transform:translateY(5px); } }
  .main-content > :first-child,.rh-work,.rh-guide,dialog[open] .modal-body { animation:workspace-enter .24s ease-out both; }
  .nav-item,.btn,.rh-primary,.demo-account,.role-choice { transition:background-color .16s,border-color .16s,color .16s; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
