/* ── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #1a1a2e;
  background: #f4f6fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #0057b8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ───────────────────────────────────────────────────────────── */
header {
  background: #0057b8;
  color: #fff;
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  white-space: nowrap;
  text-decoration: none;
}
.demo-link {
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  padding: .2rem .5rem;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 4px;
}
.demo-link:hover { color: #fff; border-color: #fff; text-decoration: none; }
.header-search {
  display: flex;
  flex: 1;
  max-width: 600px;
  gap: .4rem;
}
.header-search input {
  flex: 1;
  padding: .35rem .75rem;
  border: none;
  border-radius: 4px;
  font-size: 14px;
}
.header-search button {
  padding: .35rem .9rem;
  background: #ffd700;
  color: #1a1a2e;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
.header-search button:hover { background: #e6c200; }

/* ── Main ────────────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #dde2ec;
}

/* ── Search page ─────────────────────────────────────────────────────── */
.search-page h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.subtitle { color: #555; margin-bottom: 1.2rem; }
.hint { color: #888; font-size: 12px; font-style: italic; }

.search-form {
  display: flex;
  gap: .5rem;
  max-width: 700px;
  margin-bottom: 1.2rem;
}
.search-form input {
  flex: 1;
  padding: .5rem .9rem;
  border: 1px solid #c0cce0;
  border-radius: 6px;
  font-size: 15px;
}
.search-form input:focus { outline: none; border-color: #0057b8; box-shadow: 0 0 0 2px #cce0ff; }
.search-form button {
  padding: .5rem 1.2rem;
  background: #0057b8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.search-form button:hover { background: #003f8a; }

.result-count { margin-bottom: .7rem; color: #555; }
.no-results { color: #777; margin-top: 1rem; }
.error-box { background: #fff0f0; border: 1px solid #f5c6cb; color: #c00; padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; }

/* ── Results table ───────────────────────────────────────────────────── */
.results-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.results-table th {
  background: #0057b8;
  color: #fff;
  padding: .55rem .8rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}
.results-table td { padding: .45rem .8rem; border-bottom: 1px solid #e8edf5; }
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: #f0f5ff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.results-table th.num { text-align: right; padding-right: .8rem; }

/* ── Suggestions box ─────────────────────────────────────────────────── */
.suggestions {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid #dde2ec;
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
  max-width: 800px;
}
.suggestions h2 { font-size: 1.1rem; margin-bottom: .7rem; color: #0057b8; }
.suggestions ul { margin-left: 1.2rem; line-height: 1.9; }
.suggestions code { background: #eef2ff; padding: .1em .4em; border-radius: 3px; font-size: 13px; }

/* ── Property page ───────────────────────────────────────────────────── */
.property-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.property-header h1 { font-size: 1.5rem; color: #0057b8; }
.acct-num { color: #555; margin-top: .25rem; font-size: 13px; }

.value-badges { display: flex; gap: .8rem; flex-wrap: wrap; }
.badge {
  background: #fff;
  border: 1px solid #dde2ec;
  border-radius: 8px;
  padding: .6rem 1rem;
  text-align: center;
  min-width: 140px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.badge-label { display: block; font-size: 11px; color: #777; text-transform: uppercase; letter-spacing: .05em; }
.badge-value { display: block; font-size: 1.15rem; font-weight: 700; color: #0057b8; margin-top: .15rem; }

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #dde2ec;
  flex-wrap: wrap;
}
.tab {
  padding: .5rem .9rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  border-radius: 4px 4px 0 0;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
}
.tab:hover { background: #eef2ff; color: #0057b8; }
.tab.active { color: #0057b8; font-weight: 600; border-bottom-color: #0057b8; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Key-value table ─────────────────────────────────────────────────── */
.kv-table {
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  margin-bottom: 1.2rem;
  width: 100%;
  max-width: 700px;
}
.kv-table th {
  text-align: left;
  padding: .4rem .8rem;
  font-weight: 500;
  color: #444;
  background: #f8f9fc;
  border-bottom: 1px solid #e8edf5;
  width: 42%;
  white-space: nowrap;
}
.kv-table td {
  padding: .4rem .8rem;
  border-bottom: 1px solid #e8edf5;
  color: #1a1a2e;
}
.kv-table tr:last-child th,
.kv-table tr:last-child td { border-bottom: none; }

/* ── Data table (multi-row) ──────────────────────────────────────────── */
.data-table {
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  margin-bottom: 1.2rem;
  width: 100%;
  font-size: 13px;
}
.data-table th {
  background: #eef2ff;
  color: #0057b8;
  padding: .45rem .7rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid #d0d8f0;
  white-space: nowrap;
}
.data-table td {
  padding: .4rem .7rem;
  border-bottom: 1px solid #e8edf5;
  color: #1a1a2e;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f5f8ff; }

/* ── Two-col layout ──────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

h3 { font-size: .95rem; color: #0057b8; margin: 1rem 0 .5rem; text-transform: uppercase; letter-spacing: .05em; }

.empty { color: #999; font-style: italic; margin: .5rem 0 1rem; }
.empty-val { color: #bbb; }

/* Truncated values — tap/click to show full text in popup */
.trunc {
  cursor: pointer;
  border-bottom: 1px dotted #aaa;
  white-space: nowrap;
}
.trunc:hover { border-bottom-color: #0057b8; color: #0057b8; }

/* ── Tooltip popup ───────────────────────────────────────────────────── */
.tooltip-popup {
  position: absolute;
  z-index: 9999;
  background: #1a1a2e;
  color: #e8f0fe;
  padding: .6rem .9rem;
  border-radius: 6px;
  max-width: 320px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  pointer-events: auto;
}
.tooltip-popup strong { color: #ffd700; display: block; margin-bottom: .25rem; }

/* ── Info icon ───────────────────────────────────────────────────────── */
.info-icon {
  display: inline-block;
  cursor: help;
  color: #0057b8;
  font-size: 12px;
  margin-left: .3em;
  opacity: .7;
  user-select: none;
}
.info-icon:hover { opacity: 1; }
