:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #f8fafc;
  --surface-strong: #ffffff;
  --text: #182230;
  --muted: #667085;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --link: #1d4ed8;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-small: 0 1px 2px rgba(16, 24, 40, 0.06);
  --radius-xl: 16px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --safe-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-safe-area-inset-top, 0px),
    var(--tg-content-safe-area-inset-top, 0px)
  );
  --safe-bottom: max(
    env(safe-area-inset-bottom, 0px),
    var(--tg-safe-area-inset-bottom, 0px),
    var(--tg-content-safe-area-inset-bottom, 0px)
  );
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button,
input,
select,
textarea {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 1040px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 16px calc(88px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(64px + var(--safe-top));
  margin: 0 -16px 20px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: block;
  overflow: hidden;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #101828;
  border-radius: 9px;
  background: #000;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.18);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.user-chip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 42px;
}

.avatar {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  overflow: hidden;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--accent-text);
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.16);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-copy {
  display: none;
  min-width: 0;
  text-align: right;
}

.user-copy strong,
.user-copy span {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 13px;
}

.user-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.session-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.session-notice.is-error {
  align-items: flex-start;
  border-color: rgba(196, 56, 50, 0.25);
  color: var(--danger);
  background: rgba(196, 56, 50, 0.07);
}

.session-notice.is-local {
  border-color: rgba(6, 118, 71, 0.2);
  color: var(--success);
  background: rgba(6, 118, 71, 0.06);
}

.screen {
  animation: screen-in 260ms ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel {
  margin-bottom: 16px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  box-shadow: var(--shadow-small);
}

.search-panel,
.address-form {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.panel-heading,
.section-heading,
.report-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.panel-heading h1,
.panel-heading h2,
.section-heading h2,
.report-heading h2,
.report-section h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.panel-heading h1 {
  font-size: 22px;
}

.panel-heading p {
  max-width: 520px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.result-count,
.coming-soon-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
}

.field {
  position: relative;
  margin-bottom: 18px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.search-panel .panel-heading {
  margin-bottom: 18px;
}

.district-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.district-field legend {
  display: block;
  margin: 0 0 9px;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
}

.lookup-district-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.district-field .lookup-district-choice {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.lookup-district-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.lookup-district-card {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-strong);
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.02);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.lookup-district-number {
  display: grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 7px;
  color: var(--accent);
  background: rgba(29, 78, 216, 0.08);
  font-size: 11px;
  font-weight: 800;
}

.lookup-district-name {
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.lookup-district-choice input:not(:disabled) + .lookup-district-card:hover {
  border-color: #a7b7d8;
  background: #fbfcff;
}

.lookup-district-choice input:focus,
.lookup-district-choice input:focus-visible {
  box-shadow: none;
}

.lookup-district-choice input:focus-visible + .lookup-district-card {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.lookup-district-choice input:checked + .lookup-district-card {
  border-color: var(--accent);
  background: rgba(29, 78, 216, 0.055);
  box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.08);
}

.lookup-district-choice input:checked + .lookup-district-card .lookup-district-number {
  color: var(--accent-text);
  background: var(--accent);
}

.lookup-district-choice.is-disabled {
  cursor: not-allowed;
}

.lookup-district-choice.is-disabled .lookup-district-card {
  border-color: #eaecf0;
  background: #f8fafc;
  box-shadow: none;
  opacity: 0.48;
}

.lookup-district-choice.is-disabled .lookup-district-number {
  color: #667085;
  background: #eaecf0;
}

.field label,
.option-fieldset legend {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 650;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-row span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  outline: none;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  min-height: 48px;
}

input {
  padding: 0 14px;
}

textarea {
  min-height: 86px;
  resize: vertical;
  padding: 12px 14px;
  line-height: 1.45;
}

select {
  appearance: none;
  padding: 0 42px 0 14px;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--link);
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

input:invalid:not(:placeholder-shown) {
  border-color: rgba(196, 56, 50, 0.5);
}

.select-wrap,
.input-suffix,
.input-icon,
.search-control {
  position: relative;
}

.select-wrap > svg {
  position: absolute;
  width: 18px;
  height: 18px;
  right: 15px;
  top: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.input-suffix input {
  padding-right: 48px;
}

.input-suffix span {
  position: absolute;
  right: 14px;
  top: 17px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  pointer-events: none;
}

.input-icon > svg {
  position: absolute;
  z-index: 1;
  width: 21px;
  height: 21px;
  left: 14px;
  top: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  pointer-events: none;
}

.input-icon input {
  padding-left: 44px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 10px;
}

.field-hint {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.validation-popover {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 9px;
  color: var(--danger);
  background: #fff8f6;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.07);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  animation: validation-in 150ms ease both;
}

.validation-popover::before {
  position: absolute;
  width: 7px;
  height: 7px;
  top: -5px;
  left: 18px;
  transform: rotate(45deg);
  border-top: 1px solid rgba(180, 35, 24, 0.24);
  border-left: 1px solid rgba(180, 35, 24, 0.24);
  background: #fff8f6;
  content: "";
}

.validation-popover svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.field.has-error input {
  border-color: rgba(180, 35, 24, 0.52);
  background: #fffdfc;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

@keyframes validation-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.suggestion-popover {
  position: absolute;
  z-index: 20;
  width: 100%;
  max-height: 245px;
  overflow-y: auto;
  top: 76px;
  left: 0;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-strong);
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
}

.suggestion-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.suggestion-button::before {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--link);
  border-radius: 50%;
  content: "";
}

.suggestion-button:hover,
.suggestion-button.is-active {
  background: rgba(29, 78, 216, 0.07);
}

.suggestion-empty {
  padding: 11px;
  color: var(--muted);
  font-size: 13px;
}

.primary-button {
  display: grid;
  width: 100%;
  min-height: 48px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--accent-text);
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
  font-size: 14px;
  font-weight: 700;
  transition: transform 140ms ease, filter 140ms ease;
}

.primary-button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.94);
}

.button-label,
.button-loading {
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.button-label { display: flex; }
.button-loading { display: none; }

.primary-button.is-loading .button-label { display: none; }
.primary-button.is-loading .button-loading { display: flex; }

.button-label svg,
.search-control button svg,
.quiet-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.status-spinner {
  display: inline-block;
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.status-region {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.status-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.status-card.is-centered {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.status-card.is-centered h3 {
  margin: 0;
}

.status-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--link);
  background: rgba(29, 78, 216, 0.08);
  font-size: 17px;
  font-weight: 850;
}

.status-card.is-error .status-icon {
  color: var(--danger);
  background: rgba(196, 56, 50, 0.09);
}

.status-card.is-empty .status-icon {
  color: var(--warning);
  background: rgba(177, 107, 19, 0.1);
}

.status-card h3 {
  margin: 1px 0 4px;
  font-size: 15px;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-action {
  min-height: 44px;
  margin-top: 11px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
}

.choice-list {
  display: grid;
  gap: 7px;
  grid-column: 1 / -1;
  margin: 4px 0 0 51px;
}

.choice-button {
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.choice-button::after {
  color: var(--link);
  content: "→";
  font-size: 16px;
}

.results-section,
.candidate-section,
.report-section {
  margin: 8px 0 22px;
}

.result-context {
  margin: -7px 0 13px;
  padding: 10px 12px;
  border: 1px solid rgba(6, 118, 71, 0.16);
  border-radius: 10px;
  color: var(--success);
  background: rgba(6, 118, 71, 0.06);
  font-size: 12px;
  font-weight: 650;
}

.property-list,
.candidate-list,
.report-stack,
.data-card-list {
  display: grid;
  gap: 10px;
}

.candidate-list-item {
  min-width: 0;
}

.property-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-small);
}

.property-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.property-index {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.property-card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.property-location {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
}

.property-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 15px 0 0;
}

.fact {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.fact dt,
.key-value dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fact dd,
.key-value dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.property-notes {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.property-schools {
  margin-top: 14px;
}

.property-schools h4 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.property-school-list {
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  list-style: none;
}

.property-school-item {
  position: relative;
  padding: 10px 12px 10px 27px;
  color: #344054;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.property-school-item::before {
  position: absolute;
  width: 6px;
  height: 6px;
  top: 15px;
  left: 12px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.property-school-item + .property-school-item {
  border-top: 1px solid var(--line);
}

.search-control input {
  height: 52px;
  padding: 0 60px 0 44px;
}

.search-control > svg {
  position: absolute;
  z-index: 1;
  width: 21px;
  height: 21px;
  left: 14px;
  top: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-control button {
  position: absolute;
  display: grid;
  width: 44px;
  height: 44px;
  right: 4px;
  top: 4px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--accent-text);
  background: var(--accent);
}

.option-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.option-fieldset legend {
  grid-column: 1 / -1;
}

.option-toggle {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.option-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  flex: 0 0 30px;
  width: 30px;
  height: 19px;
  border-radius: 999px;
  background: rgba(110, 120, 114, 0.28);
  transition: background 150ms ease;
}

.toggle-track > span {
  position: absolute;
  width: 15px;
  height: 15px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 150ms ease;
}

.option-toggle input:checked + .toggle-track {
  background: var(--accent);
}

.option-toggle input:checked + .toggle-track > span {
  transform: translateX(11px);
}

.option-toggle input:focus-visible + .toggle-track {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.option-toggle strong,
.option-toggle small {
  display: block;
}

.option-toggle strong { font-size: 12px; }
.option-toggle small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.candidate-button {
  display: grid;
  width: 100%;
  min-height: 70px;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow-small);
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease;
}

.candidate-button:hover,
.candidate-button.is-selected {
  border-color: var(--link);
}

.candidate-button:active { transform: scale(0.992); }

.candidate-number {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: rgba(29, 78, 216, 0.08);
  font-size: 14px;
  font-weight: 700;
}

.candidate-copy strong,
.candidate-copy span {
  display: block;
}

.candidate-copy strong {
  font-size: 14px;
  line-height: 1.35;
}

.candidate-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.candidate-arrow {
  color: var(--link);
  font-size: 17px;
}

.report-heading {
  align-items: center;
}

.quiet-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
}

.report-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #c7d7fe;
  border-radius: var(--radius-xl);
  color: var(--text);
  background: #eff4ff;
  box-shadow: var(--shadow-small);
}

.report-hero h3 {
  position: relative;
  z-index: 1;
  max-width: 470px;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.report-summary-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 17px;
}

.summary-stat {
  padding: 10px;
  border: 1px solid rgba(29, 78, 216, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.summary-stat span,
.summary-stat strong { display: block; }

.summary-stat span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.summary-stat strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.report-map-card,
.report-card,
.data-card,
.report-warning {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  box-shadow: var(--shadow-small);
}

.report-map-card {
  position: relative;
  margin: 0;
}

.report-map-card img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface);
}

.report-card {
  padding: 18px;
}

.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.report-card-header h3 {
  margin: 0;
  font-size: 16px;
}

.key-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.key-value-grid.nearest-mrt-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.key-value {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.key-value.is-wide { grid-column: 1 / -1; }

.data-card {
  padding: 14px;
  box-shadow: none;
}

.data-card-title {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
}

.data-card .key-value-grid {
  gap: 6px;
}

.data-card .key-value {
  padding: 8px;
}

.sales-month-list {
  display: grid;
  gap: 16px;
}

.sales-month-group {
  min-width: 0;
}

.sales-month-title {
  margin: 0 0 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.report-disclaimer {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(29, 78, 216, 0.14);
  border-left: 3px solid var(--accent);
  border-radius: 9px;
  color: #475467;
  background: rgba(29, 78, 216, 0.045);
  font-size: 12px;
  line-height: 1.45;
}

.section-empty {
  padding: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.report-warning {
  padding: 17px;
  border-color: rgba(177, 107, 19, 0.23);
  background: rgba(177, 107, 19, 0.075);
  box-shadow: none;
}

.report-warning h3 {
  margin: 0 0 7px;
  color: var(--warning);
  font-size: 14px;
}

.report-warning ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-dashboard {
  display: grid;
  width: 100%;
  max-width: 720px;
  gap: 14px;
  margin: 0 auto;
}

.admin-dashboard .panel {
  margin-bottom: 0;
}

.admin-panel h2 {
  margin: 4px 0 0;
}

.admin-panel .status-region {
  padding: 15px;
}

.admin-status {
  margin-top: 14px;
}

.username-control {
  position: relative;
}

.username-control > span {
  position: absolute;
  z-index: 1;
  left: 14px;
  top: 15px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  pointer-events: none;
}

.username-control input {
  padding-left: 34px;
}

.admin-fieldset {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.admin-fieldset > legend {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 750;
}

.admin-bulk-toggle {
  position: relative;
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.admin-bulk-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.admin-toggle-track {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 18px;
  border-radius: 999px;
  background: rgba(110, 120, 114, 0.28);
  transition: background 150ms ease;
}

.admin-toggle-track > span {
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 150ms ease;
}

.admin-bulk-toggle input:checked + .admin-toggle-track,
.admin-bulk-toggle input:indeterminate + .admin-toggle-track {
  background: var(--accent);
}

.admin-bulk-toggle input:checked + .admin-toggle-track > span {
  transform: translateX(10px);
}

.admin-bulk-toggle input:indeterminate + .admin-toggle-track > span {
  transform: translateX(5px);
}

.admin-bulk-toggle input:focus-visible + .admin-toggle-track {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-form-actions .primary-button {
  flex: 1 1 auto;
  width: auto;
}

.district-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.district-option input:focus-visible + span {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.district-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.district-picker[aria-disabled="true"] {
  opacity: 0.5;
}

.district-option {
  position: relative;
  cursor: pointer;
}

.district-option > span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.district-option input:checked + span {
  border-color: rgba(29, 78, 216, 0.4);
  color: var(--accent);
  background: rgba(29, 78, 216, 0.08);
}

.admin-subheading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-subheading h3 {
  margin: 0;
  font-size: 14px;
}

.admin-subheading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-user-list {
  display: grid;
  gap: 8px;
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.admin-user-card.is-editing {
  border-color: rgba(29, 78, 216, 0.4);
  background: rgba(29, 78, 216, 0.04);
}

.admin-user-edit {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.admin-user-edit:hover {
  background: rgba(29, 78, 216, 0.05);
}

.admin-user-name {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.admin-user-access {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.admin-access-tag {
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(29, 78, 216, 0.07);
  font-size: 11px;
  font-weight: 650;
}

.id-grant-summary {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(196, 56, 50, 0.22);
  border-radius: 10px;
  color: var(--danger);
  background: rgba(196, 56, 50, 0.06);
  font-size: 12px;
  font-weight: 650;
}

.bottom-nav {
  position: fixed;
  z-index: 50;
  width: min(100%, 1040px);
  left: 50%;
  bottom: 0;
  padding: 0 16px var(--safe-bottom);
  transform: translateX(-50%);
  pointer-events: none;
}

.bottom-nav-inner {
  display: flex;
  min-height: 64px;
  align-items: stretch;
  justify-content: space-around;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--surface-strong);
  box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.05);
  pointer-events: auto;
}

.nav-item {
  display: flex;
  min-width: 76px;
  min-height: 52px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.nav-item.is-active {
  color: var(--accent);
  background: rgba(29, 78, 216, 0.08);
}

.toast {
  position: fixed;
  z-index: 100;
  max-width: calc(100% - 32px);
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  padding: 11px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: white;
  background: #182230;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.18);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 5px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.noscript-message {
  position: fixed;
  z-index: 200;
  inset: 20px;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 20px;
  color: var(--text);
  background: var(--surface-strong);
  text-align: center;
}

@media (min-width: 520px) {
  .app-shell { padding-right: 24px; padding-left: 24px; }
  .topbar { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
  .user-copy { display: block; }
  .panel { padding: 26px; }
  .lookup-district-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .property-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .key-value-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .key-value.is-wide { grid-column: span 2; }
  .district-picker { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

@media (min-width: 780px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    padding-right: 32px;
    padding-bottom: 32px;
    padding-left: 32px;
  }
  .topbar { margin-right: -32px; margin-left: -32px; padding-right: 32px; padding-left: 32px; }
  .topbar { order: 1; }
  .bottom-nav {
    position: static;
    order: 2;
    width: 100%;
    margin: -8px 0 20px;
    padding: 0;
    transform: none;
  }
  .bottom-nav-inner {
    min-height: 52px;
    justify-content: flex-start;
    border-bottom: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-small);
  }
  .nav-item {
    min-height: 44px;
    max-width: 180px;
  }
  #main-content { order: 3; }
}

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