.profile-shell {
  --paper:#f7f7f3; --text:#182b32; --sub:#54646a; --edge:#dce1db; --tile:#f9e8d7;
  --pad:clamp(19px,2.8vw,32px); background:var(--paper); color:var(--text); min-height:100vh;
}
.icon-bank { position:absolute; width:0; height:0; overflow:hidden; }
.profile-shell :is(a,button,summary,.icon-tile,.report-address,.status) > svg { width:19px; height:19px; flex:none; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
.profile-header { border-color:var(--edge); }
.topline,.account-page { width:min(calc(100% - 48px),1080px); margin-inline:auto; }
.topline { display:flex; align-items:center; justify-content:space-between; min-height:74px; gap:18px; }
.profile-header .brand { color:var(--text); }
.new-report { display:inline-flex; align-items:center; gap:7px; padding:9px 15px; text-decoration:none; font-size:.9rem; }
.account-page { margin-block:clamp(18px,3.2vw,40px) 45px; }
.cover { position:relative; isolation:isolate; overflow:hidden; display:flex; align-items:center; min-height:196px; padding:clamp(24px,3.8vw,44px); border-radius:24px; color:white; background:#20343d; }
.city-print { position:absolute; z-index:-2; right:0; inset-block:0; width:48%; height:100%; }
.cover::after { content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(90deg,#20343d 48%,rgba(32,52,61,.85) 56%,transparent 75%); }
.cover-copy { width:min(75%,640px); }
.eyebrow { display:flex; align-items:center; gap:8px; color:#ffc493; font-size:.7rem; font-weight:680; letter-spacing:.12em; text-transform:uppercase; }
.eyebrow::before { content:""; width:17px; height:2px; background:#ffac69; }
.cover h1 { margin-top:9px; max-width:none; font-size:clamp(2.1rem,4.5vw,3.35rem); line-height:1.1; letter-spacing:-.043em; }
#identity { display:flex; align-items:center; gap:11px; margin-top:18px; }
#identity > div { min-width:0; }
#identity strong,#identity #memberEmail { display:block; overflow-wrap:anywhere; }
#identity strong { font-size:.94rem; font-weight:620; }
#memberEmail { font-size:.84rem; color:#cfdbdc; }
.avatar { display:grid; place-items:center; flex:none; width:38px; height:38px; background:#385256; color:#f4e1bc; border:1px solid #698080; border-radius:50%; font-size:.84rem; font-weight:650; }
.dashboard { display:grid; grid-template-columns:minmax(0,1.38fr) minmax(0,1fr); gap:clamp(14px,2vw,24px); align-items:start; }
.card { min-width:0; padding:var(--pad); border:1px solid var(--edge); border-radius:21px; background:white; box-shadow:0 2px 5px #20343d04; }
.dashboard,.guest-card,.ranking-card { margin-top:clamp(15px,2vw,24px); }
.card-heading { display:flex; align-items:center; gap:12px; }
.icon-tile { display:grid; place-items:center; flex:none; width:42px; height:42px; border-radius:13px; background:var(--tile); color:#80502e; }
.icon-tile.sage { color:#466455; background:#e7eee6; }
.icon-tile svg { width:22px; height:22px; }
.card h2 { margin:0; font-size:clamp(1.16rem,2.4vw,1.47rem); line-height:1.22; letter-spacing:-.035em; }
.card-heading p,.guest-card p { margin-top:4px; color:var(--sub); font-size:.88rem; }
.count { display:inline-block; margin-left:.15em; padding:1px 7px; border-radius:7px; vertical-align:middle; color:#38535b; background:#edf1ee; font:650 .77rem/1.5 system-ui,sans-serif; }
.member-level { margin-top:20px; padding:16px; border-radius:14px; background:#f2f5f1; }
.level-heading { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; }
.level-heading h3 { display:flex; align-items:center; gap:10px; margin:0; color:#21443e; font-size:1.12rem; }
#levelNumber,.member-level small { color:#415b55; font-size:.81rem; white-space:nowrap; }
.level-badge { display:grid; place-items:center; border-radius:50%; width:30px; height:30px; background:var(--badge-bg); color:var(--badge-ink); box-shadow:inset 0 0 0 1px #182b3214; }
.level-badge svg { width:66%; height:66%; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.level-badge[data-symbol=sunrise] { --badge-bg:#fff0ce; --badge-ink:#865119; }
.level-badge[data-symbol=neighbours] { --badge-bg:#dcefeb; --badge-ink:#265d59; }
.level-badge[data-symbol=home-shield] { --badge-bg:#dce9d7; --badge-ink:#31593d; }
.level-badge[data-symbol=skyline] { --badge-bg:#dceafa; --badge-ink:#35577a; }
.level-badge[data-symbol=torch] { --badge-bg:#f7e3d9; --badge-ink:#924a30; }
#currentLevelIcon .level-badge { width:42px; height:42px; }
.level-steps { display:flex; gap:5px; margin:11px 0 8px; }
.level-steps span { flex:1; height:5px; border-radius:4px; background:#d4ded7; }
.level-steps .earned { background:#387058; }
.member-level p { margin:0; font-size:.9rem; }
.member-level summary { width:fit-content; min-height:44px; padding-block:12px; cursor:pointer; color:#2f5750; font-size:.87rem; font-weight:620; }
.member-level details { margin-bottom:-9px; }
.member-level ol { margin:0; padding:0 0 9px; list-style:none; }
.member-level li { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:9px; padding:6px 0; border-top:1px solid #d5dfd8; font-size:.88rem; }
.member-level li[aria-current] { font-weight:700; color:#21443e; }
.history-list { list-style:none; margin:22px 0 0; padding:0; }
.history-list:empty { margin:0; }
.history-list li { position:relative; display:grid; gap:8px; padding:17px 0; border-top:1px solid var(--edge); min-width:0; }
.report-title { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.plate-tag { display:inline-flex; align-items:center; min-height:30px; padding:1px 8px; border:1px solid #c4cec9; border-inline-start:4px solid #385563; border-radius:5px; color:#253a40; font:650 .96rem/1.45 ui-monospace,Menlo,monospace; letter-spacing:.025em; }
.no-plate { font-weight:620; font-size:.95rem; }
.status { display:inline-flex; gap:4px; align-items:center; padding:3px 8px; border-radius:18px; background:#e8f3ec; color:#27593b; font-size:.77rem; font-weight:630; }
.status > svg { width:14px!important; height:14px!important; stroke-width:2!important; }
.report-address { display:flex; align-items:flex-start; gap:5px; font-size:1rem; overflow-wrap:anywhere; }
.report-address > svg { width:16px!important; height:16px!important; margin-top:4px; color:#627370; }
.report-meta { display:flex; flex-wrap:wrap; gap:3px 12px; color:var(--sub); font-size:.8rem; }
.report-meta span { overflow-wrap:anywhere; }
.report-meta .reference { letter-spacing:.015em; font-variant-numeric:tabular-nums; }
.rank-link { margin-top:9px; padding:12px 0 0; display:flex; align-items:center; gap:8px; border-top:1px solid var(--edge); text-decoration:none; min-height:44px; color:#2f5157; font-size:.89rem; font-weight:600; }
.rank-link svg:last-child { margin-inline-start:auto; }
.rank-link:hover span { text-decoration:underline; }
.empty-note { margin:20px 0 12px; padding:20px 16px; border:1px dashed #c8d1c9; border-radius:12px; color:var(--sub); text-align:center; font-size:.93rem; }
.empty-note:empty,.notice:empty,.field-error:empty { display:none; }
.prefs-card form { margin-top:24px; }
.profile-shell label { color:var(--text); }
#nickHint { font-size:.81rem; color:var(--sub); }
.field-error { color:#922c27; }
#nickname[aria-invalid=true] { border-color:#ad443b; }
.profile-shell .choice { display:flex; gap:11px; align-items:flex-start; margin:18px 0 0; min-height:44px; font-size:.91rem; line-height:1.45; font-weight:540; cursor:pointer; }
.choice input { appearance:auto; width:19px; height:19px; margin:1px 0 0; flex:none; accent-color:#294d53; }
.choice small { margin-top:3px; color:var(--sub); font-size:.8rem; font-weight:400; }
.reward { margin-top:18px; overflow:hidden; border:1px solid var(--edge); border-radius:12px; background:#f6f6f2; color:#425258; }
.reward p { padding:10px 12px; font-size:.82rem; line-height:1.42; }
.keychain { display:block; width:100%; height:auto; }
.profile-shell .prize { align-items:center; margin:5px 0 12px; }
.prize:has(input:disabled) { color:var(--sub); cursor:default; }
.save-row,.login-controls { display:flex; align-items:center; gap:10px; }
.save-row button { padding-inline:22px; }
.notice:not(:empty) { color:#31584a; background:#eff5ed; padding:10px 13px; border-radius:9px; font-size:.87rem; }
.notice[data-error]:not(:empty) { color:#872f28; background:#fbefec; }
#accountNotice:not(:empty) { margin-top:15px; }
.member-tools { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin:14px 0 0; }
.member-tools summary { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; color:var(--sub); background:transparent; cursor:pointer; font-size:.85rem; font-weight:520; padding:7px 3px; }
.member-tools summary:hover { color:#263d43; background:transparent; text-decoration:underline; }
.member-tools summary { list-style:none; }
.member-tools summary::-webkit-details-marker { display:none; }
.member-tools details { max-width:390px; text-align:right; }
.member-tools details[open] svg { transform:rotate(180deg); }
.member-tools details p { font-size:.88rem; margin:4px 0 10px; }
.guest-card { display:flex; gap:16px; max-width:670px; }
.guest-card > :last-child,.guest-card form { min-width:0; flex:1; }
.guest-card label { margin-top:20px; }
.login-controls input { flex:1; }
.guest-card button { flex:none; }
#confirmKey { margin-top:14px; }
.ranking-table { width:100%; margin-top:22px; border-collapse:collapse; }
.ranking-table th,.ranking-table td { text-align:left; padding:12px 8px; border-block-end:1px solid var(--edge); overflow-wrap:anywhere; }
.ranking-table th { font-size:.82rem; font-weight:550; color:var(--sub); }
.ranking-table :is(td,th):last-child { text-align:right; font-variant-numeric:tabular-nums; }
.ranking-participant { display:flex; align-items:center; gap:8px; }
.ranking-participant .level-badge { flex:none; }
.ranking-nickname { min-width:0; overflow-wrap:anywhere; }
.rank-position { display:inline-grid; flex:none; place-items:center; min-width:28px; padding:1px 4px; background:#edf1ec; color:#46605b; border-radius:6px; font:620 .8rem/1.6 system-ui,sans-serif; }
.profile-shell .site-footer { padding-inline:max(20px,calc((100% - 1080px)/2)); color:var(--sub); }
@media(max-width:760px) {
  .topline,.account-page { width:calc(100% - 32px); }
  .topline { min-height:60px; display:grid; grid-template-columns:1fr auto; gap:0 8px; padding-top:3px; }
  .new-report { justify-self:end; }
  .site-tabs { grid-row:2; grid-column:1/-1; margin-block:5px 9px; justify-self:center; }
  .dashboard { grid-template-columns:minmax(0,1fr); }
  .cover { min-height:160px; border-radius:18px; }
  .city-print { width:47%; }
  .cover-copy { width:82%; }
  .cover::after { background:linear-gradient(90deg,#20343d 46%,rgba(32,52,61,.8) 60%,rgba(32,52,61,.15) 80%); }
  .card { border-radius:17px; }
}
@media(max-width:460px) {
  .account-page { margin-top:14px; }
  .cover { padding:21px 18px; }
  .city-print { width:43%; }
  .cover-copy { width:83%; }
  .history-list { margin-top:17px; }
  .guest-card { display:block; }
  .guest-card .icon-tile { margin-bottom:12px; }
  .login-controls { align-items:stretch; flex-direction:column; }
  .member-tools summary { text-align:right; }
}

.auth-box { flex:1; min-width:0; }
.auth-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:18px; }
.auth-box #confirmKey { margin:0; }
.member-tools { flex-wrap:wrap; }

.account-settings { margin-top:18px; padding:18px; }
.linked-accounts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; max-width:480px; }
.linked-accounts:not(:has([data-facebook]:not([hidden]))), .linked-accounts:has(#linkGoogleSection[hidden]) { grid-template-columns:minmax(0,1fr); }
.linked-accounts:has(#linkGoogleSection[hidden]):not(:has([data-facebook]:not([hidden]))) { display:none; }
.linked-accounts > *, #linkGoogleSection { min-width:0; }
.profile-shell .linked-accounts .social-login-button { width:100%; min-height:48px; height:100%; padding:10px; font-size:.85rem; line-height:1.3; white-space:normal; }
.profile-shell .linked-accounts .social-login-button > svg { width:20px; height:20px; stroke:none; }
#linkGoogleSection:has(#memberGoogle:not(:empty)) > #linkGoogle { display:none; }
#linkGoogleSection .google-login:not(:empty) { margin:0; }
.account-settings .member-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:10px; max-width:480px; }
.account-settings .member-tools > button { width:100%; min-width:0; min-height:44px; padding:10px; gap:6px; font-size:.85rem; line-height:1.3; }
.account-settings .member-tools details { grid-column:1 / -1; max-width:none; padding-top:8px; border-top:1px solid var(--edge); text-align:left; }
.account-settings .member-tools summary { text-align:left; }

.admin-card { margin-top:18px; padding:0; }
.admin-card > summary { min-height:52px; padding:14px 18px; cursor:pointer; font-size:.94rem; font-weight:650; }
.admin-card[open] { padding:0 18px 18px; }
.admin-card[open] > summary { margin-inline:-18px; margin-bottom:8px; }
.admin-card label { margin-top:16px; }
.admin-card select { padding:8px; font:inherit; }
.admin-card p { margin:12px 0; font-size:.9rem; }
#adminRows { padding:0; list-style:none; }
#adminRows li { border-block-start:1px solid var(--edge); padding:10px 0; }
#adminRows li span { display:block; overflow-wrap:anywhere; color:var(--sub); }

.password-field { position:relative; }
.auth-box .password-field input { padding-inline-end:52px; }
.password-field input::-ms-reveal { display:none; }
.auth-box .password-field .password-toggle {
  position:absolute; inset-inline-end:3px; top:50%; transform:translateY(-50%);
  width:44px; height:44px; min-height:44px; padding:0;
}
.auth-box .password-field .password-toggle:focus-visible { outline-offset:-3px; }
.report-reminder { display:flex; align-items:center; gap:5px 12px; flex-wrap:wrap; margin-top:4px; }
.report-reminder small,.reminder-notice { font-size:.82rem; color:var(--sub); }
.report-reminder > small:first-child:not(.reminder-date) { flex-basis:100%; }
.report-reminder button { font-size:.86rem; min-height:44px; }
.report-reminder button:disabled { opacity:.63; cursor:default; }
.reminder-notice:empty { display:none; }
.reminder-confirm { width:100%; padding:12px 14px; background:#f1f5f1; border-radius:12px; }
.reminder-confirm p { margin:0 0 9px; font-size:.9rem; }
.reminder-confirm .quiet { margin-left:8px; }

.ranking-totals { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--edge); }
.ranking-totals h2 { margin-bottom: 14px; }
.total-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 12px; }
.total-grid p { padding: 14px 16px; border-radius: 12px; background: #edf2f7; }
.total-grid strong { display: block; color: #194f89; font-size: 1.8rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.total-grid span { display: block; margin-top: 4px; font-size: .92rem; line-height: 1.4; }

.user-search { max-width:34rem; }
.user-rows { list-style:none; padding:0; margin:0; }
.user-rows li { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:16px 0; border-top:1px solid var(--edge); }
.user-info { min-width:0; overflow-wrap:anywhere; }
.user-info strong,.user-info small { display:block; }
.user-info small { margin-top:3px; color:var(--sub); }
.user-badge { display:inline-block; margin-top:6px; padding:2px 9px; border-radius:20px; font-size:.78rem; font-weight:650; color:#28553a; background:#e8f3ec; }
.user-badge.blocked { color:#86371f; background:#fcebe3; }
.user-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.user-actions button { min-height:44px; }
.user-actions .user-danger { color:#812a25; background:#fae9e6; border:1px solid #dcb4ad; }
#userPager { padding-top:10px; }
#userDialog { background:white; color:var(--text); border:1px solid var(--edge); border-radius:18px; padding:clamp(18px,4vw,30px); width:min(27rem,calc(100% - 32px)); max-height:85vh; overflow:auto; margin:auto; box-shadow:0 14px 50px #182b3230; }
#userDialog::backdrop { background:#172b347a; }
#userIdentity { color:var(--sub); overflow-wrap:anywhere; }
#userDialog .user-actions { margin-top:20px; }
#userDialogStatus:empty,#userResult:empty { margin:0; }
@media (max-width:620px) { .user-rows li { align-items:start; flex-direction:column; } .user-rows button { font-size:.86rem; padding-inline:12px; } }

.edit-avatar { position:relative; display:inline-grid; padding:0; min-width:46px; min-height:46px; border:0; border-radius:50%; background:transparent; }
.edit-avatar .avatar { width:46px; height:46px; overflow:hidden; }
.edit-mark { position:absolute; right:-2px; bottom:-1px; display:grid; place-items:center; width:19px; height:19px; border:2px solid #20343d; border-radius:50%; background:white; color:#23434c; }
.edit-mark svg { width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.avatar img,.ranking-avatar img { display:block; width:100%; height:100%; object-fit:cover; }
.avatar-emoji { font:normal 1.5rem/1 "Apple Color Emoji","Segoe UI Emoji",sans-serif; }
.avatar.has-art,.ranking-avatar { background:#f4ebdc; color:#263c40; }
#avatarDialog { width:min(27rem,calc(100% - 32px)); max-height:85vh; overflow:auto; margin:auto; padding:clamp(18px,4vw,30px); border:1px solid var(--edge); border-radius:18px; background:#fff; color:var(--text); }
#avatarDialog::backdrop { background:#172b347a; }
#avatarDialog h2 { margin:0; }
.avatar-source { display:flex; align-items:center; gap:16px; margin:16px 0; }
.avatar-source .avatar { width:72px; height:72px; overflow:hidden; border:0; font-size:1.35rem; }
.avatar-source .avatar-emoji { font-size:2.4rem; }
.avatar-source .auth-link { display:block; font-size:.84rem; }
#avatarPresets { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:4px; }
#avatarPresets button { display:grid; place-items:center; min-width:0; padding:0; min-height:44px; border:2px solid transparent; border-radius:12px; background:#f6f3ed; }
#avatarPresets button[aria-pressed=true] { border-color:#315f56; background:#e7eee8; }
#avatarDialog .user-actions { margin-top:20px; }
#avatarShareHint { color:var(--sub); }
.ranking-avatar { display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:50%; overflow:hidden; }
.ranking-avatar .avatar-emoji { font-size:1.26rem; }
#avatarControls { margin:0; padding:0; border:0; min-width:0; }
.ranking-identity { display:grid; gap:2px; min-width:0; }
.ranking-level-name { color:var(--sub); font-size:.78rem; line-height:1.3; }

.field-rows { padding-left:1.3rem; }
.field-stop { padding:1rem 0; border-bottom:1px solid var(--line,#ccc); overflow-wrap:anywhere; }
.field-stop p, .field-stop details, #fieldNext { margin:.6rem 0; }
.field-stop .user-actions { margin-top:.8rem; }
#fieldPanel > div, #fieldStaffForm { margin-block:1rem; }
#fieldPanel select, #fieldPanel input:not([type=checkbox]) { max-width:100%; }
#fieldStaffList li { display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; }

.field-account .dashboard, .field-account #emailPreferences, .field-account .linked-accounts, .field-account .member-tools details, .field-account #memberPassword { display:none; }

.profile-deletion { margin-top:12px; }
.profile-deletion summary { width:fit-content; min-height:44px; padding:10px 0; cursor:pointer; color:var(--sub); text-decoration:underline; text-underline-offset:.18em; }
.profile-deletion[open] { padding:0 16px 14px; border:1px solid var(--edge); border-radius:14px; }
.profile-deletion p { margin:6px 0 12px; overflow-wrap:anywhere; }
.profile-deletion button { min-height:44px; }
