/* Solar Tax Pros brand: deep navy + electric blue (from solartaxpros.com) */
:root {
  --bg: #070b18;
  --panel: #0c1326;
  --panel-2: #111a33;
  --line: #1d2a4a;
  --text: #f4f7ff;
  --muted: #9fb0cc;
  --blue: #2770ff;
  --blue-dark: #1f63ff;
  --blue-light: #5b9bff;
  --yes: #22c55e;
  --no: #ef4444;
  --maybe: #f59e0b;
  --head: "Unbounded", "Archivo", sans-serif;
  --body: "Archivo", Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
button { font: inherit; cursor: pointer; }
a { color: var(--blue-light); }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.01em; }

/* Top bar */
.topbar { height: 72px; display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(4, 6, 15, .92); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { height: 60px; width: auto; }
.brand span { font-family: var(--head); font-weight: 600; font-size: 15px; }
.brand:hover span { color: var(--blue-light); }
.period-bar { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.period-bar label { color: var(--muted); font-size: 13px; }
select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font: inherit; }
nav { display: flex; align-items: center; gap: 4px; }
.link { background: none; border: 0; color: var(--text); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.link:hover { background: var(--panel-2); }

/* Buttons */
.btn { display: inline-block; background: linear-gradient(180deg, var(--blue), var(--blue-dark)); color: #fff; border: 0;
  border-radius: 12px; padding: 10px 18px; font-weight: 700; text-decoration: none;
  box-shadow: 0 0 18px rgba(39, 112, 255, .45); }
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); box-shadow: none; width: 100%; }
.btn.secondary:hover { border-color: var(--blue); }
.btn.secondary.active { background: var(--blue); border-color: var(--blue); }

/* Layout */
.layout { display: flex; height: calc(100% - 72px); }
.panel { width: 560px; flex: none; overflow-y: auto; padding: 20px; background: var(--panel); border-right: 1px solid var(--line); }
.panel h2 { margin: 0 0 6px; font-size: 18px; }
.hint { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
#search { width: 100%; margin-bottom: 10px; }
#view { flex: 1; min-width: 0; }

/* Result card */
.result { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--panel-2); }
.result.empty { color: var(--muted); font-size: 14px; }
.addr-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.addr { font-weight: 600; margin-bottom: 10px; }
.layer-label { font-size: 13px; color: var(--muted); }
.state { font-size: 13px; margin-bottom: 10px; }
.status { font-family: var(--head); font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.status::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.status.yes::before { background: var(--yes); box-shadow: 0 0 10px var(--yes); }
.status.maybe::before { background: var(--maybe); box-shadow: 0 0 10px var(--maybe); }
.status.no::before { background: var(--no); box-shadow: 0 0 10px var(--no); }
.secondary-msg { margin: 6px 0 14px; text-align: center; font-style: italic; color: #d6def0; }
.req { width: 100%; border-collapse: collapse; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.req th { background: var(--blue); color: #fff; padding: 8px; text-align: center; font-family: var(--head); font-size: 13px; font-weight: 600; }
.req td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.req td small { display: block; color: var(--muted); margin-top: 2px; }
.req .grp td { text-align: center; font-weight: 700; color: var(--blue-light); background: var(--bg); }
.req .op td { text-align: center; font-style: italic; font-weight: 700; border-bottom: 0; padding: 2px; color: var(--muted); }
.req td.pf { width: 72px; text-align: center; }
.mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-weight: 700; font-size: 15px; color: #fff; background: #5b6782; flex: none; }
.mark.pass { background: var(--yes); }
.mark.fail { background: var(--no); }
.mark.potential { background: var(--maybe); }
.note { font-size: 11px; font-style: italic; color: var(--muted); margin: 10px 0 0; }
.cta { margin-top: 16px; display: flex; gap: 8px; }
.cta .btn { flex: 1; text-align: center; }

/* Welcome */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: radial-gradient(circle at 50% 30%, #0b2a7a 0%, #06102e 40%, #04050d 80%); }
.overlay.hidden { display: none; }
.welcome-card { max-width: 680px; text-align: center; }
.welcome-logo { width: 150px; height: auto; filter: drop-shadow(0 0 24px rgba(39, 112, 255, .6)); }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; color: var(--blue-light); margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.welcome-card h1 { font-size: 34px; line-height: 1.25; margin: 14px 0 16px;
  background: linear-gradient(180deg, #fff, #9fb8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 17px; color: #d6def0; }
.q { margin-top: 28px; font-weight: 600; }
.period-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.period-list button { background: rgba(17, 26, 51, .8); color: var(--text); border: 1px solid var(--line);
  padding: 16px; border-radius: 12px; font-weight: 600; }
.period-list button:hover { border-color: var(--blue); box-shadow: 0 0 16px rgba(39, 112, 255, .4); }

/* Dialogs */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  max-width: 560px; width: calc(100% - 32px); padding: 24px; }
dialog.wide { max-width: 760px; }
dialog::backdrop { background: rgb(2 4 12 / .75); }
dialog h2 { margin-top: 0; }
dialog h3 { font-size: 15px; color: var(--blue-light); margin: 20px 0 8px; }
dialog li { margin-bottom: 6px; }
.dialog-logo { display: block; width: 90px; margin: 0 auto 8px; }
#contact-dialog { text-align: center; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.dialog-actions .btn.secondary { width: auto; }
.fine { font-size: 12px; color: var(--muted); }
.legend { list-style: none; padding: 0; }
.legend li { display: flex; align-items: center; gap: 10px; }
.status-chip { flex: none; min-width: 170px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; }
.status-chip.yes { background: rgba(34, 197, 94, .15); color: var(--yes); }
.status-chip.maybe { background: rgba(245, 158, 11, .15); color: var(--maybe); }
.status-chip.no { background: rgba(239, 68, 68, .15); color: var(--no); }
.contact-list { display: grid; gap: 10px; margin: 18px 0 8px; text-align: left; }
.contact-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.contact-item:hover { border-color: var(--blue); box-shadow: 0 0 14px rgba(39, 112, 255, .35); }
.contact-item > span { font-size: 22px; }
.contact-item b { display: block; }
.contact-item small { color: var(--muted); }

@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 16px; }
  .brand span { display: none; }
  .period-bar { margin-left: 0; order: 3; width: 100%; }
  .layout { flex-direction: column-reverse; height: auto; }
  #view { flex: none; height: 55vh; }
  .panel { width: 100%; border-right: 0; }
  .welcome-card h1 { font-size: 24px; }
}

/* ---------- Embedded (iframe) mode ----------
   The page grows to fit its content and embed.js resizes the iframe, so nothing scrolls inside the embed.
   No vh units here: the iframe height follows the content, so vh would feed back into itself. */
.embed, .embed body { height: auto; min-height: 0; overflow: hidden; }
.embed .overlay { position: static; inset: auto; min-height: 640px; padding: 48px 16px; overflow: visible; }
/* While the welcome screen shows, hide the app so the embed is only as tall as the welcome content. */
.embed body:has(#welcome:not(.hidden)) .topbar,
.embed body:has(#welcome:not(.hidden)) .layout { display: none; }
.embed .layout { height: auto; align-items: stretch; }
.embed .panel { overflow: visible; }
.embed #view { min-height: 680px; }
.embed dialog { margin: 24px auto auto; max-height: none; }

@media (max-width: 900px) {
  .embed .layout { flex-direction: column-reverse; }
  .embed #view { flex: none; min-height: 0; height: 440px; }
  .embed .welcome-card h1 { font-size: 24px; }
}
@media (max-width: 480px) {
  .embed .overlay { min-height: 0; padding: 32px 16px; }
  .embed #view { height: 360px; }
}
