* { box-sizing: border-box; }
:root {
    color-scheme: light;
    --blue: #085D8A;
    --silver: #A9ABAE;
    --ink: #172d3a;
    --muted: #506473;
    --paper: #f4f7f9;
    --white: #fff;
    --line: #d5dfe5;
}
body { margin: 0; font-family: Inter, "Segoe UI", Arial, sans-serif; background: var(--paper); color: var(--ink); line-height: 1.5; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); line-height: 1.12; letter-spacing: -.055em; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; letter-spacing: -.035em; }
h3 { font-size: 1.1rem; }
a { color: var(--blue); font-weight: 650; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
button,input,select { font: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; box-shadow: 0 0 0 2px white; }
.bar { background: var(--blue); color: #fff; }
.bar-inner,.wrap { width: min(1140px, calc(100% - 64px)); margin: auto; }
.bar-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brandlink,.brandlink:hover { color: inherit; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.85rem; font-weight: 730; letter-spacing: -.08em; line-height: 1; }
.brand i { display: block; width: 20px; height: 24px; border: 3px solid var(--silver); border-right: 0; border-radius: 2px; position: relative; }
.brand i::after { content: ""; position: absolute; top: 2px; bottom: -3px; left: 5px; width: 10px; background: var(--silver); transform: skewY(-17deg); }
.product { color: #e7eff4; font-size: .8rem; border-left: 1px solid #86acc1; padding-left: 22px; }
.signout { margin-left: auto; }
.ghost { border: 1px solid var(--silver); background: transparent; color: #fff; padding: 6px 18px; border-radius: 7px; cursor: pointer; }
.wrap { padding: 46px 0 72px; }
.titleline,.panelhead,.formactions,.tabs,.pager,.fieldpair,.search { display: flex; align-items: center; gap: 14px; }
.titleline,.panelhead { justify-content: space-between; }
.titleline { margin-bottom: 28px; align-items: flex-end; }
.overline { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 740; color: var(--blue); margin-bottom: 9px; }
.muted,small { color: var(--muted); }
.muted { margin-top: 9px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 43px; padding: 9px 16px; border-radius: 8px; border: 1px solid #aabdc9; background: #fff; color: var(--ink); font-weight: 650; font-size: .9rem; text-decoration: none; cursor: pointer; line-height: 1.35; }
.btn:hover { background: #eaf3f8; text-decoration: none; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: #064967; }
.metrics { display: grid; grid-template-columns: repeat(4,1fr); background: var(--blue); color: #fff; border-radius: 14px; padding: 22px 0; margin-bottom: 30px; }
.metric { display: flex; flex-direction: column-reverse; padding: 0 clamp(12px,3vw,34px); }
.metric + .metric { border-left: 1px solid #76a4bd; }
.metric span { font-size: .84rem; color: #e8f2f7; }
.metric strong { font-weight: 620; color: var(--white); font-size: clamp(1.7rem, 3.6vw, 2.7rem); line-height: 1.2; letter-spacing: -.06em; }
.panel,.auth-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 12px #14374a0a; }
.panelhead,.tabs { padding: 20px 24px; flex-wrap: wrap; }
.search { gap: 7px; flex-wrap: wrap; }
.search input { width: min(215px, 100%); height: 39px; }
.small { min-height: 39px; }
.textlink { font-size: .85rem; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .91rem; }
th,td { padding: 15px 18px; border-top: 1px solid var(--line); }
th { font-size: .73rem; letter-spacing: .04em; color: var(--muted); background: #f3f7fa; }
td { overflow-wrap: anywhere; } td:last-child { white-space: nowrap; }
td:first-child,th:first-child { padding-left: 24px; }
.item { font-weight: 670; color: var(--ink); text-decoration: none; }
.empty { border-top: 1px solid var(--line); padding: 40px 24px 44px; text-align: center; }
.empty p { margin-top: 5px; color: var(--muted); }
.back { display: inline-flex; text-decoration: none; margin-bottom: 22px; font-size: .88rem; }
.tabs { padding-bottom: 0; gap: 22px; border-bottom: 1px solid var(--line); }
.tabs a { text-decoration: none; padding-bottom: 12px; border-bottom: 3px solid transparent; color: var(--muted); }
.tabs a[aria-current] { border-color: var(--blue); color: var(--blue); }
.tabs span { font-size: .78rem; border-radius: 12px; background: #e6f0f5; padding: 2px 8px; }
.pager { justify-content: center; border-top: 1px solid var(--line); padding: 15px; font-size: .86rem; }
.editor { max-width: 680px; padding: clamp(18px,3vw,32px); }
.stack { display: grid; gap: 18px; }
.stack label { display: block; font-weight: 620; font-size: .91rem; }
input,select { min-width: 0; padding: 10px 12px; border: 1px solid #8298a6; border-radius: 7px; background: #fff; color: var(--ink); }
.stack input:not([type=hidden]),.stack select { width: 100%; display: block; margin-top: 6px; height: 45px; }
.fieldpair { align-items: flex-start; } .fieldpair label:first-child { flex: 1; } .fieldpair label:last-child { width: 115px; }
.formactions { justify-content: flex-end; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 20px; }
.notice,.error { border: 1px solid #a7cfb5; background: #e8f5eb; color: #214e34; border-radius: 8px; padding: 11px 15px; margin-bottom: 18px; }
.error { background: #fff2eb; border-color: #edc1a9; color: #7e391a; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--blue); }
.auth-wrap { width: min(430px,100%); }
.auth-brand { display: flex; align-items: center; justify-content: space-between; color: white; margin-bottom: 22px; }
.auth-brand > span:last-child { font-size: .84rem; color: #e3eef4; }
.auth-card { padding: clamp(22px, 4vw, 34px); }
.auth-card h1 { font-size: 2.35rem; }
.auth-card form { margin-top: 24px; }
.sr,.skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: absolute; background: white; padding: 8px; }
@media(max-width: 650px) {
    .bar-inner,.wrap { width: calc(100% - 32px); } .bar-inner { gap: 14px; }
    .wrap { padding-top: 28px; } .titleline { align-items: flex-start; flex-direction: column; gap: 16px; }
    .panelhead,.tabs { padding-left: 14px; padding-right: 14px; } .panelhead { gap: 12px; }
    .metric span { font-size: .75rem; } .metrics { padding: 16px 0; }
    .search { width: 100%; } .search input { flex: 1; width: 120px; }
    th,td { padding: 12px 10px; } td:first-child,th:first-child { padding-left: 14px; }
    .tabs { gap: 14px; } .tabs a { font-size: .88rem; } .empty { padding: 28px 14px; }
}

.classifications { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.classifications fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
.classifications legend { padding: 0; margin-bottom: 6px; font-size: .91rem; font-weight: 620; }
.choices { display: grid; grid-template-columns: 1fr 1fr; }
.choices label { display: flex; align-items: center; gap: 6px; padding: 10px 8px; border: 1px solid #8298a6; font-size: .83rem; cursor: pointer; }
.choices label:first-child { border-radius: 7px 0 0 7px; }
.choices label:last-child { border-radius: 0 7px 7px 0; border-left: 0; }
.choices label:has(:checked) { background: #e5f1f7; color: var(--blue); }
.choices input[type="radio"] { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); flex: none; }
.earlier { margin-top: 18px; }
@media(max-width: 680px) { .classifications { grid-template-columns: 1fr; } }
@media(max-width: 500px) {
    .metrics { grid-template-columns: repeat(2,1fr); row-gap: 14px; }
    .metric:nth-child(3) { border-left: 0; }
}

.address-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cep-feedback { color: var(--muted); font-size: .88rem; }
.cep-feedback:has(#cep-status:empty) { display: none; }
.cep-feedback button[hidden] { display: none; }
@media(max-width: 480px) { .address-pair { grid-template-columns: 1fr; } }

.client-tools, .view-switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-switch { flex-wrap: nowrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.view-switch a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: .85rem; text-decoration: none; }
.view-switch a[aria-current="true"] { background: var(--blue); color: white; }
.view-switch a:not([aria-current]):hover { color: var(--blue); background: #e6eff5; }
.view-list, .view-grid { display: inline-block; width: 13px; height: 13px; }
.view-list { background: repeating-linear-gradient(to bottom, currentColor 0 2px, transparent 2px 5px); }
.view-grid { background: conic-gradient(at 5px 5px, transparent 25%, transparent 50%, transparent 75%, currentColor 75%) 0 0 / 8px 8px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px,100%), 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0 24px 24px; }
.client-card { display: flex; height: 100%; align-items: center; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; padding: 20px 14px 16px; color: var(--ink); text-align: center; text-decoration: none; }
.client-card:hover { background: #f4f9fc; border-color: var(--blue); text-decoration: none; }
.client-card strong { line-height: 1.3; overflow-wrap: anywhere; }
.client-card small { margin-top: 5px; font-size: .83rem; font-weight: 400; }
.client-emblem { width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 12px; }
.client-emblem img, .current-logo { width: 84px; height: 84px; object-fit: contain; }
.client-emblem span { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 15px; background: #e4f0f7; color: var(--blue); font-size: 1.55rem; font-weight: 700; text-transform: uppercase; }
.logo-field small { display: block; margin-top: 4px; font-weight: 400; }
.current-logo { display: block; margin-top: 8px; }
.stack .logo-field input[type=file] { height: auto; padding: 8px; }
@media(max-width: 650px) {
    .client-tools { width: 100%; }
    .client-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 14px 16px; gap: 8px; }
    .client-card { padding: 14px 8px; }
}

.resident-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.resident-actions, .editor:has(select[name=u]) + .panel, .panel:has(#resident-invite-url) + .panel { margin-top:18px; }
.resident-actions { margin-bottom:18px; }
.residents-form small { display:block; margin-top:4px; font-weight:400; }
.residents-form textarea { display:block; width:100%; margin-top:6px; padding:10px; border:1px solid var(--line); border-radius:6px; font:inherit; resize:vertical; }
.residents-form input[type=file] { height:auto; padding:9px; }
.resident-public { max-width:780px; }
.resident-avatar,.resident-portrait { object-fit:cover; border-radius:8px; width:38px; height:38px; }
.resident-portrait { width:84px; height:84px; }
.resident-name { display:flex; align-items:center; gap:8px; }
#resident-address { width:100%; }
@media(max-width:600px) { .resident-pair { grid-template-columns:1fr; } }
