:root {
  color-scheme: light;
  --navy: #152238;
  --yellow: #ffff00;
  --paper: #faf9f5;
  --ink: #172032;
  --muted: #555e6d;
  --line: #e3e3dd;
  --white: #fff;
  --max: 60rem;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; line-height: 1.22; }
h2 { font-size: 1.07rem; }
h3 { font-size: 1rem; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #3267a5; outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.top { background: var(--white); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-inner, .main, .nav-inner { width: min(100%, var(--max)); margin-inline: auto; }
.top-inner { min-height: 54px; padding: 7px 16px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 760; text-decoration: none; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; }
.pill { font-size: .75rem; font-weight: 650; background: #edf0f4; padding: 5px 9px; border-radius: 7px; }
.main { padding: 13px 14px calc(86px + env(safe-area-inset-bottom)); }
.narrow { max-width: 30rem; }
.page-title { background: var(--navy); color: var(--white); border-radius: 12px; min-height: 54px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.page-title h1 { font-size: clamp(1.2rem, 5.4vw, 1.45rem); font-weight: 730; letter-spacing: -.035em; }
.page-title span { color: #ffff77; font-size: .75rem; font-weight: 650; text-align: right; flex: none; }
.section-title { margin: 17px 0 8px; }
.section-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 11px 0 8px; }
.section-line small, .task h2 small { font-size: .78rem; color: var(--muted); font-weight: 500; }

.lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.field-label { display: block; margin-bottom: 5px; font-size: .78rem; font-weight: 650; }
.search-box { display: flex; min-width: 0; align-items: center; border: 1px solid #d6d9df; background: var(--white); border-radius: 9px; gap: 7px; padding-inline: 10px; }
.search-box:focus-within { outline: 2px solid #3267a5; outline-offset: 1px; }
.search-box .icon { color: var(--muted); }
.search-box input { min-width: 0; width: 100%; background: transparent; border: 0; padding: 8px 0; font-size: 16px; min-height: 44px; }
.search-box input:focus-visible { outline: 0; }
.primary, .secondary { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: .88rem; font-weight: 690; text-decoration: none; text-align: center; }
.primary { background: var(--yellow); color: var(--navy); }
.secondary { background: var(--white); border-color: #d6d9df; }
.primary:hover { background: #eded00; }
.secondary:hover { background: #eff2f6; }
.wide { width: 100%; }
.lookup .primary { min-width: 4.75rem; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; }
.chip { min-height: 38px; display: inline-flex; align-items: center; border-radius: 25px; border: 1px solid var(--line); background: var(--white); padding: 0 8px; font-size: .74rem; text-decoration: none; }
.chip.selected { background: #e7edf5; color: var(--navy); border-color: #e7edf5; font-weight: 700; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.panel > .list-row:first-child { border-radius: 11px 11px 0 0; }
.panel > .list-row:last-child { border-radius: 0 0 11px 11px; }
.panel > .list-row:only-child { border-radius: 11px; }
.padded, .form-panel { padding: 14px; }
.task { margin-bottom: 10px; }
.association { margin-bottom: 15px; color: var(--muted); }
.form-panel { max-width: 30rem; }
.form-panel p { margin-bottom: 14px; }
.list-row { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 9px 11px; text-decoration: none; }
.list-row + .list-row { border-top: 1px solid var(--line); }
a.list-row:hover { background: #f6f8fa; }
.list-row > .icon { color: #68768a; }
.avatar { display: inline-grid; place-items: center; flex: none; min-width: 34px; height: 34px; padding: 0 4px; border-radius: 9px; background: #e9eff8; color: #314666; font-size: .72rem; font-weight: 760; }
.list-row:nth-child(3n+2) .avatar { background: #f4f2d3; color: #5d511b; }
.list-row:nth-child(3n+3) .avatar { background: #e7f2ea; color: #255d45; }
.row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-main strong { font-size: .91rem; }
.row-main small, .member-heading p { color: var(--muted); display: block; margin-top: 2px; font-size: .77rem; }
.chinese { color: var(--muted); margin-left: 4px; font-weight: 460; }
.empty { color: var(--muted); padding: 13px; }
.pager { display: flex; justify-content: end; gap: 8px; margin-top: 10px; }
.member-heading { display: flex; align-items: center; gap: 9px; min-height: 38px; }
.member-heading > div { min-width: 0; }
.portrait { width: 47px; height: 47px; object-fit: cover; border-radius: 9px; }
.lookup-result, .membership-card { padding: 10px 11px; }
.membership-card { border-color: #e7e4b8; background: #f8f6d1; }
.card-status, .call-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; margin-top: 7px; border-top: 1px solid var(--line); padding-top: 7px; font-size: .85rem; }
.call-line { padding-top: 0; min-height: 36px; }
.call-line a { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; font-weight: 650; }
.call-line .icon { width: .92rem; }
.card-status span, .call-line span { color: var(--muted); }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 10px 14px; }
.details div { min-width: 0; }
.details dt { font-size: .77rem; color: var(--muted); }
.details dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.field { display: grid; gap: 5px; margin-bottom: 11px; font-size: .83rem; font-weight: 650; }
.field input, .field select { width: 100%; min-width: 0; min-height: 44px; background: var(--white); border: 1px solid #d6d9df; border-radius: 8px; font-size: 16px; font-weight: 400; padding: 7px 9px; }
.field input[type="file"] { min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 10px; padding: 3px 10px; }
legend { font-size: .87rem; font-weight: 650; }
.check { display: flex; align-items: center; gap: 7px; min-height: 42px; }
.check input { width: 17px; height: 17px; accent-color: var(--navy); }
.form-grid { display: grid; gap: 0 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 7px; }
.spaced { margin-top: 12px; }
.notice { margin-bottom: 9px; padding: 10px 11px; background: #eaf0f8; border-radius: 9px; overflow-wrap: anywhere; }
.notice code, .notice small { display: block; margin-top: 5px; }
.notice code { font-size: 1rem; user-select: all; }

.bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 2; border-top: 1px solid var(--line); background: var(--white); padding: 3px 0 env(safe-area-inset-bottom); }
.nav-inner { display: flex; }
.nav-inner a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; text-decoration: none; font-size: .68rem; font-weight: 620; color: var(--muted); }
.nav-inner a span { display: grid; place-items: center; width: 42px; height: 25px; border-radius: 8px; }
.nav-inner a[aria-current] { color: var(--navy); font-weight: 740; }
.nav-inner a[aria-current] span { background: var(--yellow); }
.keyboard-open .bottom { display: none; }
.keyboard-open .main { padding-bottom: 18px; }
@media (min-width: 42rem) {
  .top-inner, .main { padding-inline: 22px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory .row-main { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 11px; align-items: center; }
  .directory .row-main small { margin: 0; }
  .nav-inner { max-width: 37rem; }
}

.directory-sort { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: #edf0f4; }
.directory-sort a { min-height: 36px; min-width: 74px; display: grid; place-items: center; padding: 0 9px; text-decoration: none; border-radius: 6px; font-size: .79rem; font-weight: 700; }
.directory-sort a[aria-current] { background: var(--navy); color: var(--white); }
.directory-number { min-width: 49px; border-radius: 7px; padding: 5px; text-align: center; color: var(--navy); background: #e9edf3; font-size: .91rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.credential { display: grid; grid-template-columns: clamp(86px, 28vw, 160px) minmax(0, 1fr); gap: clamp(13px, 4vw, 35px); align-items: center; padding: clamp(13px, 3vw, 26px); border-radius: 10px; border-left: 4px solid var(--yellow); background: linear-gradient(114deg, #192942, #101928); color: #fff; }
.credential-photo { aspect-ratio: 4 / 5; display: grid; place-items: center; overflow: hidden; border-radius: 5px; border: 1px solid #b2bed065; background: #263958; }
.credential-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.credential-issuer { display: flex; align-items: center; gap: 6px; font-size: clamp(.6rem, 2vw, .77rem); letter-spacing: .11em; font-weight: 720; color: #dce5f2; }
.credential-issuer img { width: 23px; height: 23px; }
.credential-number { color: var(--yellow); font-size: clamp(2rem, 8vw, 4.65rem); font-weight: 820; line-height: 1.02; letter-spacing: .045em; font-variant-numeric: tabular-nums; margin: 4px 0; }
.credential h2 { font-size: clamp(.91rem, 3.6vw, 1.4rem); }
.credential-data p { font-size: .83rem; color: #e3e8f2; margin-top: 3px; }
.credential-area { display: inline-block; margin-top: 7px; padding: 3px 7px; border: 1px solid #a9b8ce63; border-radius: 4px; font-size: .72rem; color: #e3e8f2; }
.credential + .membership-card { margin-top: 8px; }
.profile-actions { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photo-editor summary { display: inline-flex; list-style: none; }
.photo-editor summary::-webkit-details-marker { display: none; }
.photo-editor .panel { margin-top: 7px; }
.photo-editor { max-width: 100%; }
.photo-editor[open] { flex-basis: 100%; }

.directory-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-block: 8px; }
.directory-columns .column-on { background: var(--navy); color: #fff; }
.directory-columns a { min-width: 44px; min-height: 44px; padding: 0; color: #46566e; }
.directory-table thead .icon { width: 1rem; height: 1rem; }
.directory-export { margin-left: auto; }
.directory-browse { overflow: hidden; }
.directory-table { width: 100%; border-collapse: collapse; font-size: .9rem; overflow-wrap: anywhere; }
.directory-table th, .directory-table td { padding: .67rem .72rem; text-align: left; vertical-align: top; }
.directory-table thead { background: #f2f4f7; color: #3b4a60; font-size: .76rem; }
.directory-table tbody tr { border-top: 1px solid var(--line); }
.directory-browse tr:hover { background: #f8fafd; }
.directory-table .directory-number { display: inline-block; }
.directory-table td a { text-underline-offset: 3px; }
.member-name-cell a { text-decoration-color: #adb9ca; }
.member-chinese { display: block; color: var(--muted); margin-top: .14rem; }
.member-phone-cell a { white-space: nowrap; }
.mobile-column-label { display: none; }
@media (max-width: 40rem) {
  .directory-export { margin-left: 0; }
  .directory-browse table, .directory-browse tbody { display: block; }
  .directory-browse thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .directory-browse tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .7rem; padding: .67rem .72rem; }
  .directory-browse tbody tr:first-child { border-top: 0; }
  .directory-browse td { padding: 0; }
  .directory-browse .member-number-cell { grid-row: span 2; }
  .directory-browse .member-area-cell { grid-column: 2; color: var(--muted); font-size: .79rem; }
  .directory-browse .member-phone-cell, .directory-browse .member-address-cell { grid-column: 2; margin-top: .35rem; }
  .directory-browse .mobile-column-label { display: inline-flex; vertical-align: middle; margin-right: .4rem; color: var(--muted); }
  .directory-browse .mobile-column-label .icon { width: .95rem; height: .95rem; }
  .directory-empty { grid-column: 1 / -1; }
}
