:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #292927;
  background: #f5f5f3;
  font-synthesis: none;
  --bg: #f5f5f3;
  --surface: #fcfcfb;
  --raised: #ffffff;
  --text: #292927;
  --muted: #6d6d66;
  --accent: #6a5bc4;
  --accent-soft: #efedf9;
  --green: #4d7c68;
  --amber: #875a32;
}

* { box-sizing: border-box; }
html { background: var(--bg); overscroll-behavior-y: contain; }
body { margin: 0; min-width: 320px; overflow-x: clip; -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain; }
button, input, textarea, select { font: inherit; }
input::placeholder, textarea::placeholder { color: #6d6d66; opacity: 1; }
button { min-width: 44px; min-height: 44px; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .5; }
button, input, textarea, select { border: 0; outline: none; }
button { background: none; }
button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #6a5bc455; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #6a5bc433; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }
strong, .metrics strong { font-variant-numeric: tabular-nums; }
p, h1, h2 { text-wrap: pretty; }
[hidden] { display: none !important; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { max-width: 760px; margin: 0 auto; min-height: 100dvh; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: max(20px, env(safe-area-inset-top)) 22px 8px; }
.brand { flex: 0 0 auto; padding: 8px 0; font-size: 21px; font-weight: 680; letter-spacing: .08em; }
.brand span { margin-left: 9px; color: var(--muted); font-size: 9px; font-weight: 520; letter-spacing: .17em; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #65a184; box-shadow: 0 0 0 4px #65a18412; }
.status-dot.offline { background: #aa784c; box-shadow: 0 0 0 4px #aa784c12; }
.status-dot.failed { background: #a55353; box-shadow: 0 0 0 4px #a5535312; }
main { padding: 0 22px calc(124px + env(safe-area-inset-bottom)); }
.view { display: none; animation: enter .36s cubic-bezier(.215,.61,.355,1); }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; filter: blur(6px); transform: translateY(5px); } to { opacity: 1; filter: blur(0); transform: none; } }
.hero { padding: 42px 2px 26px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 10px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(36px, 9vw, 58px); line-height: 1.12; letter-spacing: -.055em; font-weight: 630; }
.hero > p:last-child, .page-heading > p:last-child { margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.page-heading { padding: 36px 2px 25px; }
.page-heading h1 { font-size: 38px; }
.inline-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.inline-heading > div { min-width: 0; }
.text-button { min-height: 44px; padding: 0; color: var(--accent); font-size: 13px; }
.inline-create { flex: 0 0 auto; padding: 0 4px; font-weight: 580; white-space: nowrap; }
.search-box { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px #29292703; color: var(--muted); transition: box-shadow .2s; }
.search-box:focus-within { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #6a5bc42e; }
.search-box input { width: 100%; min-height: 48px; padding: 0; color: var(--text); background: transparent; box-shadow: none; font-size: 16px; }
.search-box input:focus { box-shadow: none; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 32px; padding: 18px 0; border-radius: 18px; background: var(--surface); }
.metrics button { min-height: 54px; }
.metrics button + button { box-shadow: -1px 0 0 #29292708; }
.metrics strong, .metrics span { display: block; }
.metrics strong { font-size: 24px; font-weight: 590; letter-spacing: -.04em; }
.metrics span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 12px; }
.section-heading h2 { margin: 0; font-size: 16px; font-weight: 620; }
.section-heading button, .section-heading span { min-height: 44px; color: var(--muted); font-size: 12px; }
.people-list { display: grid; gap: 9px; }
.person-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 13px; min-height: 76px; padding: 12px 14px; border-radius: 17px; background: var(--surface); text-align: left; transition: transform .2s, background .2s; }
.person-row:active { transform: scale(.985); }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--avatar, #e9e5f5); color: var(--ink, #564a91); font-size: 15px; font-weight: 640; }
.person-main { min-width: 0; }
.person-main strong { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 15px; font-weight: 610; }
.person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.core-mark { flex: 0 0 auto; color: var(--amber); font-size: 11px; }
.person-main p { overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.person-meta { text-align: right; }
.relation-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 20px; background: #efede8; color: #716b61; font-size: 10px; white-space: nowrap; }
.person-meta small { display: block; margin-top: 5px; color: #73736c; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0 18px; scrollbar-width: none; }
.chips button { flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--surface); color: var(--muted); font-size: 12px; }
.chips button.active { background: #33332f; color: #f7f7f4; font-weight: 440; }
.empty-state { padding: 52px 0; color: var(--muted); text-align: center; font-size: 13px; }
.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 760px; margin: auto; padding: 8px 14px max(16px, env(safe-area-inset-bottom)); background: #fcfcfbed; backdrop-filter: blur(20px); box-shadow: 0 -0.5px 0 #2929270d, 0 -12px 32px #29292705; }
.bottom-nav button { min-height: 54px; color: #73736c; font-size: 10px; }
.bottom-nav svg { display: block; margin: 0 auto 5px; font-size: 20px; }
.bottom-nav button.active { color: var(--text); font-weight: 600; }
.add-button { position: fixed; z-index: 11; right: max(22px, calc((100vw - 716px) / 2)); bottom: calc(74px + max(16px, env(safe-area-inset-bottom))); display: grid; place-items: center; width: 56px; height: 56px; border-radius: 19px; background: #33332f; color: #fafaf7; box-shadow: 0 12px 30px #33332f29; transition: transform .2s; }
.add-button:active { transform: scale(.94); }
.add-button svg { font-size: 23px; }
.activity-list { display: grid; gap: 12px; }
.activity-card { padding: 20px; border-radius: 20px; background: var(--surface); }
.activity-card time { color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
.activity-card h2 { display: -webkit-box; overflow: hidden; margin: 10px 0 8px; font-size: 17px; font-weight: 610; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.activity-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.activity-people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.activity-people span { padding: 5px 9px; border-radius: 8px; background: #f1f1ee; color: #6d6d66; font-size: 10px; }
.graph-card { position: relative; overflow: hidden; height: min(58vh, 500px); min-height: 390px; border: .5px solid #29292708; border-radius: 24px; background: var(--surface); box-shadow: 0 16px 40px #29292707; touch-action: none; }
#networkGraph { width: 100%; height: 100%; cursor: grab; }
#networkGraph:active { cursor: grabbing; }
#networkGraph .graph-node-label { stroke-linejoin: round; }
.graph-tools { position: absolute; right: 12px; bottom: 14px; display: flex; gap: 8px; padding: 5px; border: .5px solid #2929270a; border-radius: 16px; background: #f0f0ede8; backdrop-filter: blur(12px); box-shadow: 0 8px 24px #29292712; }
.graph-tools button { width: 48px; height: 48px; min-height: 48px; border-radius: 11px; font-size: 20px; }
.graph-tools button:active { background: #e5e5e0; }
.graph-hint { position: absolute; bottom: 27px; left: 16px; max-width: 118px; color: #6d6d66; font-size: 10px; line-height: 1.5; }
.graph-focus { min-height: 72px; margin-top: 13px; padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.graph-focus strong { font-size: 14px; }
.graph-focus p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 4px; color: var(--muted); font-size: 10px; }
.legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.legend .close { background: #7e69bf; }.legend .friendly { background: #6c9985; }.legend .new { background: #c4a074; }.legend .referral { background: #ce8b71; }
.privacy-card { display: flex; gap: 12px; padding: 20px; border-radius: 20px; background: #edf2ed; }
.privacy-card .status-dot { flex: 0 0 auto; margin-top: 7px; }
.privacy-card strong { font-size: 14px; }
.privacy-card p { margin: 6px 0 0; color: #5f6c62; font-size: 12px; line-height: 1.7; }
.usage-card { margin-top: 12px; padding: 18px; border: .5px solid #29292708; border-radius: 18px; background: var(--surface); }
.usage-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.usage-heading .eyebrow { margin-bottom: 7px; }
.usage-heading h2 { margin: 0; font-size: 15px; font-weight: 620; }
.usage-heading > strong { color: var(--accent); font-size: 17px; font-weight: 620; white-space: nowrap; }
.usage-card > p { margin: 14px 0 6px; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-card > small { color: var(--muted); font-size: 11px; line-height: 1.65; }
.sync-failures { margin-top: 16px; padding: 0 14px 14px; border: .5px solid #a5535326; border-radius: 18px; background: #fbf6f4; }
.sync-failure-note { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sync-failure-list { display: grid; gap: 10px; }
.sync-failure-item { min-width: 0; padding: 12px; border-radius: 13px; background: var(--surface); }
.sync-failure-main strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sync-failure-main p { margin: 6px 0 0; color: #8f4747; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.settings-group { margin-top: 20px; padding: 0 16px; border-radius: 18px; background: var(--surface); }
.settings-group button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 58px; text-align: left; font-size: 13px; }
.settings-group button + button { box-shadow: 0 -1px 0 #29292708; }
.settings-group small { color: var(--muted); font-size: 11px; }
.security-group { padding-bottom: 16px; }
.security-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 8px; }
.security-heading h2 { margin: 0; font-size: 15px; font-weight: 620; }
.settings-group .security-heading button { flex: 0 0 auto; width: auto; min-height: 44px; padding: 0; color: var(--accent); font-size: 12px; }
.security-note { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.security-password { padding: 16px 0; box-shadow: 0 -1px 0 #29292708; }
.security-password > label { color: var(--muted); font-size: 11px; }
.password-save-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 8px; }
.security-password input { width: 100%; min-width: 0; min-height: 48px; padding: 0 13px; border-radius: 12px; background: #f2f2ef; color: var(--text); font-size: 16px; }
.settings-group .password-save-row button { width: auto; min-height: 48px; padding: 0 15px; border-radius: 12px; background: #33332f; color: #fafaf7; font-size: 12px; white-space: nowrap; }
.security-password .form-status { margin-top: 10px; }
.security-devices { padding-top: 8px; box-shadow: 0 -1px 0 #29292708; }
.security-devices h3 { margin: 8px 0; font-size: 13px; font-weight: 610; }
.device-list { display: grid; gap: 10px; margin-top: 10px; }
.device-item { min-width: 0; padding: 13px; border-radius: 14px; background: #f2f2ef; }
.device-item.current { box-shadow: inset 3px 0 var(--accent); }
.device-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.device-head strong { font-size: 13px; font-weight: 610; }
.device-badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 9px; font-size: 10px; white-space: nowrap; }
.device-badge.trusted { background: #e7efe9; color: #456b58; }
.device-badge.expired { background: #f4ecdf; color: #835b36; }
.device-times { margin-top: 10px; }
.device-times p, .device-expiry { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; font-variant-numeric: tabular-nums; }
.device-times time { overflow-wrap: anywhere; }
.device-expiry { margin-top: 8px; }
.settings-group .device-item .card-actions { margin-top: 8px; }
.settings-group .device-revoke { width: auto; min-height: 44px; padding: 0 12px; border-radius: 10px; background: #fcfcfb; color: #a55353; font-size: 11px; }
.device-empty { margin: 0; }
.version { margin-top: 28px; color: #73736c; text-align: center; font-size: 10px; }

.sheet { position: fixed; inset: auto 0 0; width: min(100%, 760px); max-height: 80dvh; margin: auto; padding: 10px 22px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 40vh; border: .5px solid #29292708; border-radius: 26px 26px 0 0; background: var(--surface); color: var(--text); box-shadow: 0 -20px 70px #2929271f; -webkit-overflow-scrolling: touch; }
.sheet::backdrop { background: #29292745; backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-in .32s cubic-bezier(.215,.61,.355,1); }
.sheet::before { content: ""; display: block; width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 4px; background: #d8d8d2; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.sheet-handle { display: flex; justify-content: center; }
.sheet-handle button { width: 48px; height: 44px; }
.sheet-handle button::before { content: ""; display: block; width: 34px; height: 4px; margin: auto; border-radius: 4px; background: #d8d8d2; }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-heading > div { min-width: 0; }
.sheet-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.icon-button { width: 48px; height: 48px; min-height: 48px; color: var(--muted); font-size: 26px; }
.sheet-note { color: var(--muted); font-size: 12px; line-height: 1.65; }
textarea { width: 100%; min-height: 126px; margin: 8px 0 12px; padding: 15px; resize: vertical; border-radius: 15px; background: #f2f2ef; color: var(--text); font-size: 16px; line-height: 1.7; transition: box-shadow .2s; }
.file-row, .draft-actions { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.file-row > span, .draft-actions > span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.primary-button, .secondary-button { min-height: 48px; padding: 0 17px; border-radius: 13px; font-size: 13px; font-weight: 560; }
.primary-button { width: 100%; background: #33332f; color: #fafaf7; }
.primary-button:disabled { cursor: default; opacity: .35; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; background: #efefec; color: #5f5f59; }
.full-width { width: 100%; margin-top: 18px; }
.person-hero { padding: 22px 0; text-align: center; }
.person-hero .avatar { margin: 0 auto 14px; width: 72px; height: 72px; border-radius: 23px; font-size: 22px; }
.person-hero h2 { margin: 0; font-size: 27px; overflow-wrap: anywhere; }
.person-hero p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-cell { min-height: 78px; padding: 14px; border-radius: 15px; background: #f2f2ef; }
.detail-cell small { display: block; color: var(--muted); font-size: 10px; }
.detail-cell strong { display: block; margin-top: 8px; font-size: 13px; font-weight: 560; overflow-wrap: anywhere; }
.detail-note { padding: 18px 4px; color: #62625c; font-size: 13px; line-height: 1.8; }
.toast { position: fixed; z-index: 30; right: max(86px, calc((100vw - 716px) / 2 + 64px)); bottom: calc(78px + max(16px, env(safe-area-inset-bottom))); left: max(22px, calc((100vw - 716px) / 2)); max-width: 560px; margin: 0 auto; padding: 11px 16px; border-radius: 12px; background: #33332f; color: #fafaf7; font-size: 12px; text-align: center; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translateY(0); }

.auth-screen { max-width: 520px; min-height: 100dvh; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom)); }
.auth-brand { font-size: 21px; font-weight: 680; letter-spacing: .08em; }
.auth-brand span { margin-left: 9px; color: var(--muted); font-size: 9px; letter-spacing: .17em; }
.auth-hero { padding: clamp(48px, 10vh, 104px) 0 32px; }
.auth-hero > p:last-child { margin-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.auth-card { display: grid; gap: 18px; padding: 22px; border: .5px solid #29292708; border-radius: 22px; background: var(--surface); box-shadow: 0 18px 48px #29292708; }
.auth-card .full-width { margin-top: 0; }
.auth-mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: #f2f2ef; }
.auth-mode-toggle button { min-height: 44px; padding: 4px 8px; border-radius: 11px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.auth-mode-toggle button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px #2929270a; font-weight: 580; }
.auth-method-fields { display: grid; gap: 18px; }
.auth-method-note { margin: -4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-field, .form-fields label, #deleteAccountForm label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
.auth-card input, .form-fields input, .form-fields select, #deleteAccountForm input { width: 100%; min-width: 0; min-height: 48px; padding: 0 13px; border-radius: 12px; background: #f2f2ef; color: var(--text); font-size: 16px; }
.captcha-row { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.captcha-image { display: grid; place-items: center; width: 116px; height: 52px; min-height: 52px; padding: 3px; overflow: hidden; border: .5px solid #2929270d; border-radius: 12px; background: #f2f2ef; color: var(--muted); font-size: 10px; }
.captcha-image > span { display: grid; place-items: center; width: 100%; height: 100%; }
.captcha-image svg { display: block; width: 108px; height: 42px; fill: initial; stroke: none; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.code-row .secondary-button { min-width: 122px; padding: 0 12px; white-space: nowrap; }
#codeRow { display: grid; gap: 14px; }
.auth-foot { color: var(--muted); text-align: center; font-size: 11px; line-height: 1.7; }
.dev-code { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f4ecdf; color: #835b36; font-size: 13px; font-variant-numeric: tabular-nums; }
.form-status { min-height: 18px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.form-status.error { color: #a55353; }
.bottom-nav.five { grid-template-columns: repeat(5, 1fr); }
.round-add { flex: 0 0 auto; width: 48px; height: 48px; min-height: 48px; border-radius: 15px; background: #33332f; color: #fafaf7; font-size: 22px; }
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-links button { min-height: 78px; padding: 13px; border-radius: 15px; background: var(--surface); text-align: left; font-size: 12px; }
.quick-links span { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.search-results { display: grid; gap: 8px; margin-top: 8px; }
.search-results:empty { display: none; }
.search-result { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border-radius: 13px; background: var(--surface); text-align: left; }
.search-result > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result small { flex: 0 0 auto; color: var(--muted); }
.text-link { min-height: 44px; margin-top: 15px; color: var(--accent); font-size: 12px; }
.card-list, .relation-list, .ledger-list { display: grid; gap: 10px; }
.org-card { width: 100%; padding: 14px 16px; border-radius: 16px; background: var(--surface); text-align: left; }
.org-card-head { display: flex; align-items: center; gap: 10px; }
.org-card h2 { flex: 1; min-width: 0; overflow: hidden; margin: 0; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.org-count { flex: 0 0 auto; padding: 5px 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 10px; white-space: nowrap; }
.org-card p { display: block; overflow: hidden; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; text-overflow: ellipsis; white-space: nowrap; }
.org-card .tag-list { margin-top: 10px; }
.tag-list, .detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list span, .detail-tags span { padding: 5px 9px; border-radius: 8px; background: #f1f1ee; color: #676760; font-size: 10px; }
.graph-filter, .filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.graph-filter { justify-content: space-between; }
.graph-filter label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.graph-filter select, .filter-row select { min-height: 44px; padding: 0 28px 0 10px; border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12px; }
.graph-filter > span { color: var(--muted); font-size: 10px; }
.filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.filter-row > label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 11px; }
.filter-row select { min-width: 0; width: 100%; }
.breadcrumbs { display: flex; gap: 8px; overflow-x: auto; margin: 4px 0 10px; scrollbar-width: none; }
.breadcrumbs:empty { display: none; }
.breadcrumbs button { flex: 0 0 auto; min-height: 44px; padding: 0 10px; color: var(--muted); font-size: 11px; }
.breadcrumbs button:last-child { color: var(--accent); }
.legend .general { background: #aaa69b; }
.graph-detail-actions { display: flex; gap: 8px; margin-top: 10px; }
.graph-detail-actions button { min-height: 44px; padding: 0 12px; border-radius: 10px; background: #efefec; color: var(--accent); font-size: 11px; }
.graph-connections { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.activity-card { width: 100%; text-align: left; }
.activity-card .activity-open { display: block; width: 100%; text-align: left; }
.activity-people button { min-height: 44px; padding: 5px 11px; border-radius: 10px; background: #f1f1ee; color: #6d6d66; font-size: 10px; }
.relation-card { position: relative; min-width: 0; padding: 10px 12px; border-radius: 15px; background: var(--surface); }
.relation-card.pending { box-shadow: inset 3px 0 #c6a174; }
.relation-head { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 6px; min-height: 44px; }
.relation-head strong { min-width: 0; overflow: hidden; font-size: 13px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.relation-card .relation-basis { overflow: hidden; margin: 1px 40px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.relation-badges { display: flex; flex: 0 0 auto; gap: 4px; }
.relation-badges span { padding: 3px 6px; border-radius: 7px; background: #f1f1ee; color: #5f5f59; font-size: 10px; white-space: nowrap; }
.relation-menu { position: relative; width: 44px; height: 44px; }
.relation-menu summary { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--muted); cursor: pointer; font-size: 20px; list-style: none; }
.relation-menu summary::-webkit-details-marker, .confirmed-relations > summary::-webkit-details-marker { display: none; }
.relation-menu summary:hover, .relation-menu[open] summary { background: #efefec; }
.relation-menu-actions { position: absolute; z-index: 6; top: 44px; right: 0; display: grid; width: 112px; padding: 6px; border: .5px solid #29292712; border-radius: 12px; background: var(--raised); box-shadow: 0 10px 30px #29292724; }
.relation-menu-actions button { width: 100%; min-height: 44px; border-radius: 8px; text-align: left; padding: 0 12px; font-size: 12px; }
.relation-menu-actions .danger-text { color: #a55353; }
.relation-confirm { margin-top: 4px; }
.confirmed-relations > summary { min-height: 48px; margin-top: 16px; cursor: pointer; list-style: none; }
.confirmed-relations > summary::after { content: "⌄"; margin-left: 8px; color: var(--muted); font-size: 16px; transition: transform .2s; }
.confirmed-relations[open] > summary::after { transform: rotate(180deg); }
.confirmed-relations > summary #confirmedCount { margin-left: auto; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card-actions button { min-height: 44px; padding: 0 13px; border-radius: 10px; background: #efefec; color: #65655f; font-size: 11px; }
.card-actions .confirm-action { background: #e7efe9; color: #456b58; }
.card-actions .danger-text { color: #a55353; }
.ledger-item { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 15px 0; box-shadow: 0 1px 0 #2929270a; }
.ledger-item time { color: var(--muted); font-size: 10px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.ledger-item strong, .ledger-detail strong { font-size: 12px; font-weight: 580; }
.ledger-item p, .ledger-detail p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.ledger-group > summary { grid-template-columns: 74px minmax(0, 1fr) 20px; cursor: pointer; list-style: none; }
.ledger-group > summary::-webkit-details-marker { display: none; }
.ledger-group > summary::after { content: "⌄"; align-self: center; color: var(--muted); font-size: 16px; transition: transform .2s; }
.ledger-group[open] > summary::after { transform: rotate(180deg); }
.ledger-group-details { margin: 0 0 12px 86px; padding: 4px 12px; border-radius: 12px; background: var(--surface); }
.ledger-detail { min-width: 0; padding: 10px 0; }
.ledger-detail + .ledger-detail { box-shadow: 0 -1px 0 #2929270a; }
.ledger-detail strong, .ledger-detail p { overflow-wrap: anywhere; }
.danger-button { width: 100%; min-height: 48px; margin-top: 24px; color: #a55353; font-size: 12px; }
.danger { color: #a55353; }
.danger-solid { width: 100%; min-height: 48px; margin-top: 12px; border-radius: 13px; background: #a55353; color: white; font-size: 13px; }
.form-fields { display: grid; gap: 14px; margin: 20px 0 12px; }
.form-fields textarea { min-height: 100px; margin: 0; }
.form-fields .check-label { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-size: 13px; }
.form-fields .check-label input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }
.form-hint { margin: -5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.offline-note { padding: 10px 12px; border-radius: 10px; background: #f4ecdf; color: #835b36; font-size: 11px; line-height: 1.6; }
.consent-sheet .sheet-note { margin: 20px 0 12px; color: var(--text); font-size: 14px; line-height: 1.8; }
.consent-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.consent-actions { display: grid; gap: 10px; margin-top: 24px; }
.consent-actions .full-width { margin-top: 0; }
.consent-actions .text-button { color: var(--muted); }
.draft-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; overflow: visible; margin: 14px 0; }
.draft-item { display: block; min-width: 0; padding: 8px 10px; border: .5px solid #2929270a; border-radius: 16px; background: #f5f5f2; }
.draft-head { display: flex; align-items: center; gap: 4px; min-width: 0; }
.draft-check { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; cursor: pointer; }
.draft-check input { width: 20px; height: 20px; min-height: 20px; margin: 0; accent-color: var(--accent); }
.draft-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 14px; align-items: center; gap: 6px; flex: 1; min-width: 0; min-height: 48px; padding: 4px 0; text-align: left; }
.draft-summary-line { min-width: 0; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.draft-action { padding: 4px 7px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 10px; white-space: nowrap; }
.draft-confidence { color: var(--muted); font-size: 10px; white-space: nowrap; }
.draft-chevron { color: var(--muted); font-size: 14px; transition: transform .2s; }
.draft-summary[aria-expanded="true"] .draft-chevron { transform: rotate(180deg); }
.draft-detail { padding-bottom: 4px; }
.draft-meta { margin: 4px 0 8px 44px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.draft-evidence { margin: 10px 0; padding: 10px 12px; border-left: 2px solid #d6d1c7; border-radius: 0 10px 10px 0; background: #fcfcfba8; color: #6d6d66; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.draft-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.draft-item .draft-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-height: 0; padding: 0; color: var(--muted); font-size: 11px; font-weight: 400; }
.draft-field > span { display: block; }
.draft-item .draft-field input { width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 0 13px; border: .5px solid #29292708; border-radius: 12px; background: var(--raised); color: var(--text); font-size: 16px; }
.draft-item .card-actions { margin-top: 12px; }
.draft-confirm-bar { position: sticky; z-index: 4; bottom: 0; margin: 12px -4px -12px; padding: 12px 4px; background: var(--surface); box-shadow: 0 -12px 18px #fcfcfbd9; }
.draft-confirm-bar #confirmDraft { margin: 0; }
.quota-fallback { margin: 12px 0; padding: 14px; border-radius: 14px; background: #f4ecdf; }
.quota-fallback p { margin: 0 0 10px; color: #835b36; font-size: 12px; line-height: 1.65; }
.quota-fallback .full-width { margin-top: 0; background: #fcfcfb; }
.detail-section { margin-top: 22px; }
.detail-section h3 { margin: 0 0 10px; font-size: 14px; }
.detail-section > p { color: var(--muted); font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.detail-list { display: grid; gap: 8px; }
.detail-list button, .detail-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 10px 13px; border-radius: 12px; background: #f2f2ef; text-align: left; text-decoration: none; font-size: 12px; }
.detail-list button > span, .detail-list a > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-list small { flex: 0 0 auto; max-width: 45%; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.detail-phone { text-align: left; }
.material-link { color: var(--accent); }
.ledger-item > div, .graph-focus { min-width: 0; }
.ledger-item strong, .graph-focus strong, .graph-focus p, .graph-connections { overflow-wrap: anywhere; }
.tag-list span, .detail-tags span { max-width: 100%; overflow-wrap: anywhere; }
.toast { overflow-wrap: anywhere; }
.search-empty { margin: 0; text-align: center; }
.empty-inline { padding: 12px 0; color: var(--muted); font-size: 12px; }


@media (min-width: 700px) {
  .topbar { padding-right: 32px; padding-left: 32px; }
  main { padding-right: 32px; padding-left: 32px; }
  .hero { padding-top: 62px; }
  #home .people-list { grid-template-columns: 1fr 1fr; }
  .graph-card { height: 540px; }
  .activity-list { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.profile-entry { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 88px; max-width: 170px; padding: 9px 14px; border: 1px solid #ad8a6030; border-radius: 14px; background: #ad8a6007; }
.profile-entry-label { font-size: 13px; font-weight: 600; }
.profile-entry-status { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--muted); }
.profile-entry[data-sync="synced"] { border-color: #65a18438; background: #65a18408; }
.profile-entry[data-sync="syncing"] { border-color: #7b91b438; background: #7b91b408; }
.profile-entry[data-sync="failed"] { border-color: #a5535340; background: #a5535308; }
#feedbackForm select { display: block; width: 100%; margin: 8px 0 18px; padding: 12px; border-radius: 12px; background: #f2f2ef; color: var(--text); }
