/* layout.css — shell, header, nav, footer, page containers, responsive grid */

#app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The header follows the page theme: white with a bottom border in light
   mode, the dark surface in dark mode. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  white-space: nowrap;
}
.brand__mark { width: 28px; height: 28px; display: block; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand__name { display: block; }
.brand small {
  display: block;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--fg-subtle);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg-muted);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--fg); }

#view {
  --view-pad-x: 1rem;
  --view-pad-top: 1.25rem;
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: var(--view-pad-top) var(--view-pad-x) 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.25rem 1rem;
  font-size: 0.82rem;
  color: var(--fg-subtle);
}
.site-footer__bar {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer__links { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer__copy { color: var(--fg-subtle); }

.scan-box { margin: 0 0 1.25rem; max-width: 640px; }
.scan-box .field input {
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
}
.scan-box .btn { padding: 0.7rem 1.3rem; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.page-head h1 { margin: 0; }
.page-head__meta { font-size: 0.82rem; color: var(--fg-subtle); }

.grid {
  display: grid;
  gap: 0.75rem;
}
.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.grid--two { grid-template-columns: 1fr 1fr; }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.section { margin-bottom: 1.75rem; }
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .grid--two { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  #view {
    --view-pad-x: 0.65rem;
    --view-pad-top: 0.9rem;
    padding: var(--view-pad-top) var(--view-pad-x) 2.5rem;
  }
  .brand__text { display: none; }
}

/* War-room screen mode: hide the normal chrome for a clean, full display. */
body.screen-mode .site-header,
body.screen-mode .site-footer {
  display: none;
}
body.screen-mode #view {
  max-width: none;
  padding: 0;
}

.screen-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
}
.screen-tile {
  background: var(--bg-raised);
  padding: 1.2rem 1.4rem;
}
.screen-tile__label { font-size: 0.8rem; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.4rem; }
.screen-tile__value { font-size: 2.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.screen-tile__value.is-muted { font-size: 1.3rem; font-weight: 500; color: var(--fg-subtle); }
.screen-ticker-head {
  padding: 0.9rem 1rem 0;
  margin: 0;
}
.screen-ticker {
  padding: 0.75rem 1rem;
  overflow-y: auto;
}
.screen-ticker__row {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}
.screen-ticker__row span:first-child { color: var(--fg-subtle); width: 150px; flex-shrink: 0; }
