:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #172d31;
  background: #f2f6f5;
  font-size: 16px;
  line-height: 1.6;
  --primary: #0f766e;
  --muted: #607477;
  --line: #dce6e3;
  --danger: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #0f766e; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.6px; }
h2 { font-size: 19px; line-height: 1.4; }
h3 { font-size: 17px; }
small, .muted { color: var(--muted); }
small { display: block; font-size: 14px; line-height: 1.5; }
svg { width: 22px; height: 22px; flex: 0 0 auto; }
.app { max-width: 680px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: #f7faf9; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; background: white; padding: 12px; }
.skip-link:focus { top: 8px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); background: #fff; border-bottom: 1px solid var(--line); }
.brand-icon { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 12px; color: #fff; background: var(--primary); font-size: 18px; font-weight: 800; letter-spacing: -1px; }
.brand { flex: 1; min-width: 0; }
.brand strong { display: block; font-size: 16px; }
.brand small { font-size: 13px; }
.account { position: relative; }
.account summary { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 8px; cursor: pointer; list-style: none; color: var(--muted); font-size: 14px; }
.account summary::-webkit-details-marker { display: none; }
.account-panel { position: absolute; z-index: 30; right: 0; top: 55px; width: min(280px, calc(100vw - 40px)); padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px #183c3320; }
.account-panel strong { display: block; overflow-wrap: anywhere; margin-bottom: 12px; }
.account-panel .button + .button { margin-top: 8px; }
main { padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.page-heading p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.page-heading .button { flex: 0 0 auto; }
.eyebrow { color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: 1px; margin-bottom: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px; border: 1px solid transparent; border-radius: 12px; font-size: 16px; line-height: 1.4; font-weight: 600; background: var(--primary); color: #fff; text-align: center; }
.button.secondary { background: #fff; border-color: var(--line); color: #294a4d; }
.button.quiet { background: #eaf4f1; color: var(--primary); }
.button.danger { background: #fff4f2; border-color: #f5d2cd; color: var(--danger); }
.button.solid-danger { background: var(--danger); color: white; }
.button.full { width: 100%; }
.button.icon { width: 48px; padding: 10px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; margin: -12px 0 12px; color: var(--muted); }
.search-card, .card { background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.search-card { padding: 16px; margin-bottom: 20px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.search-row .button { flex: 0 0 auto; }
.search-card > small { margin-top: 8px; }
.filters summary { min-height: 48px; padding: 12px 0; font-size: 14px; color: var(--muted); cursor: pointer; }
.filters .fields { padding-top: 6px; }
.filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #eaf0ee; padding: 4px; border-radius: 14px; margin-top: 12px; }
.tabs button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: #607477; font-weight: 600; }
.tabs button[aria-pressed="true"] { background: #fff; color: var(--primary); box-shadow: 0 1px 4px #183c3312; }
.list-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.list-heading p { font-size: 14px; color: var(--muted); }
.list-heading strong { color: #172d31; }
.user-list { display: grid; gap: 14px; }
.user-card { padding: 18px; }
.user-card-header { display: flex; align-items: flex-start; gap: 12px; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; background: #ecf5f2; color: var(--primary); }
.user-identity { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 18px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; color: #172d31; }
.user-identity small { margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 3px 8px; font-size: 13px; font-weight: 600; background: #edf5f2; color: #08714f; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.badge.closed { color: #78594f; background: #f5eeeb; }
.badge.expired { color: #9a5e11; background: #fff5df; }
.user-facts { display: grid; gap: 8px; padding: 16px 0 12px; font-size: 14px; }
.fact { display: flex; gap: 12px; justify-content: space-between; }
.fact > span:first-child { color: var(--muted); flex: 0 0 auto; }
.fact > span:last-child { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.platform-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.platform-tag { padding: 3px 8px; background: #f2f6f5; color: #45625e; border-radius: 6px; font-size: 13px; }
.card-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf1ef; }
.card-actions .button { flex: 1; padding: 10px 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; }
.pagination span { font-size: 14px; color: var(--muted); text-align: center; }
.empty { text-align: center; padding: 38px 20px; }
.empty svg { width: 36px; height: 36px; color: #8ba8a0; margin-bottom: 12px; }
.empty p { color: var(--muted); margin: 8px 0 20px; }
.loading { text-align: center; color: var(--muted); padding: 64px 20px; }
.loading::before { content: ""; display: block; width: 28px; height: 28px; border: 3px solid #d8e9e4; border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 16px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.section { padding: 20px; margin-bottom: 16px; }
.section h2 { margin-bottom: 20px; }
.section .section-intro { margin: -12px 0 20px; font-size: 14px; color: var(--muted); }
.fields { display: grid; gap: 20px; min-width: 0; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > label, .field > .label { color: #294a4d; font-size: 15px; font-weight: 600; }
input:not([type="checkbox"]), select, textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 52px; padding: 12px; color: #172d31; border: 1px solid #cbdad5; border-radius: 10px; background: #fff; font-size: 16px; line-height: 1.5; }
input[type="datetime-local"] { display: block; appearance: none; -webkit-appearance: none; }
input::-webkit-date-and-time-value { text-align: left; }
input::placeholder, textarea::placeholder { color: #758984; }
input:disabled, select:disabled { background: #f3f6f5; color: #6a7f78; }
textarea { resize: vertical; min-height: 110px; }
.readonly { overflow-wrap: anywhere; background: #f4f7f6; border-radius: 10px; padding: 12px; min-height: 50px; }
.platform-group { padding: 0; margin: 0; border: 0; min-width: 0; }
.platform-group legend { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.check-options { display: flex; flex-wrap: wrap; gap: 10px; }
.check-option { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check-option:has(input:checked) { background: #edf7f3; border-color: #95bfb1; }
.check-option:has(input:disabled) { opacity: .6; }
input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.form-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-actions { position: sticky; bottom: 0; display: flex; gap: 12px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: #f7faf9f5; border-top: 1px solid var(--line); z-index: 10; margin-top: 20px; }
.form-actions .button { flex: 1; min-height: 52px; }
.error { background: #fff2ef; color: #a32119; border: 1px solid #f2d2cc; border-radius: 10px; padding: 12px 14px; margin: 16px 0; overflow-wrap: anywhere; }
.notice { background: #edf5f2; color: #42665b; padding: 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.notice.warning { background: #fff4e8; color: #824b12; margin-top: 20px; }
.bulk-shortcuts { display: flex; gap: 10px; margin: -6px 0 20px; }
.bulk-shortcuts .button { flex: 1; min-width: 0; }
.selection-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.selection-tools .muted { font-size: 14px; }
.selection-tools .check-option { flex: 1; min-width: 170px; font-size: 14px; background: #fff; }
.select-user { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: -4px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.select-user span { min-width: 0; overflow-wrap: anywhere; }
.select-user:has(input:disabled) { color: var(--muted); cursor: default; }
.selection-bar { align-items: center; }
.selection-bar > div { flex: 1; min-width: 0; }
.selection-bar .button { flex: 0 1 auto; }
.account-textarea { min-height: 190px; }
.batch-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.batch-stats > div { padding: 14px; border-radius: 12px; background: #f0f6f3; }
.batch-stats strong { display: block; font-size: 26px; line-height: 1.4; color: var(--primary); }
.batch-stats span { font-size: 14px; color: var(--muted); }
.account-list { border: 1px solid var(--line); border-radius: 12px; margin: 16px 0; overflow: hidden; }
.account-list summary { min-height: 52px; padding: 14px; cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.account-list summary > span { margin-left: 8px; color: var(--primary); }
.account-list ul { margin: 0; padding: 0 14px; list-style: none; max-height: 320px; overflow-y: auto; }
.account-list li { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.batch-result h1 { font-size: 26px; margin-bottom: 20px; }
.batch-result .button + .button { margin-top: 12px; }
.details { margin: 0; }
.details > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid #edf1ef; }
.details > div:first-child { padding-top: 0; }
.details > div:last-child { border-bottom: 0; padding-bottom: 0; }
.details dt { color: var(--muted); font-size: 14px; }
.details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.detail-hero { margin-bottom: 20px; }
.detail-hero .user-name { font-size: 24px; }
.detail-hero .badge { margin-top: 12px; }
.login { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: max(32px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom)); }
.login .brand-icon { flex: none; width: 56px; height: 56px; border-radius: 18px; margin-bottom: 32px; font-size: 24px; }
.login h1 { font-size: 30px; }
.login > p { color: var(--muted); margin: 10px 0 32px; }
.login .button { min-height: 54px; }
.login-footer { margin-top: 28px; display: flex; justify-content: center; }
.login-footer a { display: inline-flex; align-items: center; min-height: 48px; font-size: 14px; }
.toast { position: fixed; z-index: 100; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 40px); padding: 12px 20px; background: #173a32; color: #fff; border-radius: 12px; box-shadow: 0 6px 24px #183c3330; font-size: 16px; text-align: center; }
dialog { width: calc(100% - 32px); max-width: 440px; max-height: calc(100dvh - 40px); padding: 24px; border: 0; border-radius: 20px; color: #172d31; box-shadow: 0 16px 64px #0002; }
dialog::backdrop { background: #142d2b88; }
dialog h2 { font-size: 22px; margin-bottom: 12px; }
dialog p { color: var(--muted); overflow-wrap: anywhere; }
dialog strong { color: #172d31; }
.dialog-actions { display: grid; gap: 10px; margin-top: 24px; }
.dialog-actions .button { width: 100%; min-height: 52px; }
@media (min-width: 700px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  main { padding-left: 28px; padding-right: 28px; }
  .login { padding-left: 72px; padding-right: 72px; }
}
@media (max-width: 359px) {
  main { padding-left: 14px; padding-right: 14px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .section, .user-card { padding: 16px; }
  .page-heading { flex-wrap: wrap; }
  .page-heading .button { width: 100%; }
  .user-card-header { gap: 8px; }
  .user-card .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .loading::before { animation: none; }
}
