:root {
  color-scheme: light;
  --ink: #102a4c;
  --muted: #647792;
  --line: #d9e3ef;
  --panel: rgba(255, 255, 255, 0.96);
  --blue: #1479ff;
  --blue-dark: #0b5fd2;
  --soft-blue: #eef6ff;
  --green: #1f9d62;
  --orange: #e97843;
  --purple: #7a5cff;
  --shadow: 0 14px 34px rgba(18, 48, 86, 0.16);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0f3158;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 7%, rgba(255,255,255,0.18), transparent 24rem),
    radial-gradient(circle at 88% 13%, rgba(255,255,255,0.11), transparent 22rem),
    linear-gradient(180deg, #173d68 0%, #2e6f9d 48%, #8db4d1 100%);
}

.sky {
  min-height: 100vh;
  padding: 24px 0 28px;
}

.shell {
  width: min(1500px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: white;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  font-size: 34px;
  color: #57e0bf;
  background: rgba(18, 68, 104, 0.55);
  border: 1px solid rgba(255,255,255,0.14);
}

.brand h1,
.brand p,
.header-note span {
  margin: 0;
}

.brand h1 {
  font-size: clamp(1.45rem, 2.5vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.brand p {
  margin-top: 6px;
  color: rgba(255,255,255,0.82);
  font-size: 0.98rem;
}

.header-note {
  display: grid;
  gap: 6px;
  text-align: right;
  color: rgba(255,255,255,0.84);
  font-size: 0.88rem;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.toolbar {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.location-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pin {
  color: var(--blue-dark);
  font-size: 0.9rem;
  box-shadow: 0 0 0 6px #eaf3ff;
  border-radius: 50%;
}

.toolbar h2 {
  margin: 0;
  font-size: 1.55rem;
}

.toolbar p {
  margin: 4px 0 0;
}


.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.input-panel,
.output-panel {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.section-title h2,
.section-title p {
  margin: 0;
}

.section-title h2 {
  font-size: 1.3rem;
}

.section-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .9rem;
}

.section-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--blue);
  background: #edf5ff;
  font-size: 1.25rem;
  font-weight: 800;
}

.sparkle {
  color: var(--purple);
  background: #f2efff;
}

.data-section {
  padding-top: 18px;
}

.data-section + .data-section {
  margin-top: 2px;
  border-top: 1px solid #edf1f5;
}

.data-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.subheading-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.metric {
  min-height: 76px;
  padding: 13px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #f7faff;
  text-align: center;
}

.metric-label {
  color: var(--muted);
  font-size: .77rem;
}

.metric-value {
  margin-top: 6px;
  font-size: .95rem;
  font-weight: 750;
  line-height: 1.25;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

thead {
  background: #f3f7fb;
  color: var(--muted);
}

th,
td {
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #e8eef4;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:nth-child(2) {
  white-space: normal;
  min-width: 160px;
}

.afd-preview {
  min-height: 150px;
  max-height: 240px;
  overflow: hidden;
  white-space: pre-wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
  color: #324862;
  font: 0.84rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  mask-image: linear-gradient(to bottom, black 77%, transparent 100%);
}

.details-box {
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.details-box summary {
  padding: 11px 13px;
  cursor: pointer;
  color: var(--blue-dark);
  font-size: .88rem;
  font-weight: 650;
}

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  max-height: 430px;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #2a405c;
  background: #f7f9fc;
  font: .8rem/1.48 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.model-stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.model-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: white;
  box-shadow: 0 7px 18px rgba(31,65,105,.08);
}

.model-card[data-provider="openai"] {
  --provider: #178b7d;
  --provider-soft: #eaf8f4;
}

.model-card[data-provider="anthropic"] {
  --provider: #dc6b38;
  --provider-soft: #fff4e9;
}

.model-card[data-provider="gemini"] {
  --provider: #3c73dc;
  --provider-soft: #edf5ff;
}

.model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}

.model-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.provider-mark {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--provider);
  font-weight: 850;
}

.model-name {
  font-weight: 800;
  line-height: 1.1;
}

.provider-name {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: .72rem;
}

.compliance {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
}

.compliance-dot {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: .75rem;
  font-weight: 900;
}

.compliance-dot.warn {
  background: #d79a2e;
}

.model-copy {
  margin: 0 16px 13px;
  padding: 15px;
  min-height: 95px;
  border-radius: 11px;
  background: var(--provider-soft);
  color: #182e49;
  font: .95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.model-error {
  color: #8b3c31;
  background: #fff1ee;
}

.model-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 15px;
  color: var(--muted);
  font-size: .78rem;
}

.model-stat {
  min-width: 0;
}

.model-stat strong {
  display: block;
  margin-top: 2px;
  color: #334b67;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.fairness-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--soft-blue);
  color: #2464b5;
  font-size: .86rem;
  line-height: 1.45;
}

.history-panel {
  margin-top: 14px;
  padding: 16px 18px;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.history-heading h2,
.history-heading p {
  margin: 0;
}

.history-heading h2 {
  font-size: 1.12rem;
}

.history-heading p {
  margin-top: 2px;
  font-size: .84rem;
}

.secondary-button {
  padding: 9px 13px;
  color: var(--blue-dark);
  background: #edf5ff;
}

.history-strip {
  margin-top: 12px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.history-button {
  flex: 0 0 auto;
  min-width: 108px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f8fb;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.history-button strong,
.history-button span {
  display: block;
}

.history-button strong {
  font-size: .84rem;
}

.history-button span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
}

.history-button.active {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.history-button.active span {
  color: rgba(255,255,255,.82);
}

.footer {
  padding: 18px 0 0;
  color: rgba(255,255,255,.78);
  text-align: center;
  font-size: .78rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: .77rem;
}

.empty-state,
.empty-cell {
  color: var(--muted);
}

.metrics-grid.empty-state,
.model-empty {
  display: block;
  padding: 24px;
  border: 1px dashed #c7d5e4;
  border-radius: 12px;
  background: #f8fbfe;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 15px;
  border-radius: 10px;
  color: white;
  background: #203c5d;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .sky {
    padding-top: 14px;
  }

  .shell {
    width: min(100% - 20px, 1500px);
  }

  .site-header,
  .toolbar,
  .history-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .header-note {
    display: none;
  }




  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .model-stats {
    grid-template-columns: 1fr;
  }

  .subheading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

/* Phone layout: prioritize the model comparison and keep dense weather data usable. */
@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0;
    background: linear-gradient(180deg, #173d68 0%, #2e6f9d 58%, #8db4d1 100%);
  }

  .sky,
  .shell,
  main,
  .main-grid,
  .input-panel,
  .output-panel,
  .history-panel,
  .data-section {
    min-width: 0;
    max-width: 100%;
  }

  .sky {
    padding: 10px 0 20px;
  }

  .shell {
    width: calc(100% - 16px);
  }

  .site-header {
    min-height: 0;
    gap: 8px;
    padding: 4px 2px 12px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    font-size: 26px;
  }

  .brand h1 {
    font-size: 1.35rem;
  }

  .brand p {
    margin-top: 3px;
    font-size: .78rem;
    line-height: 1.3;
  }

  .toolbar {
    margin-bottom: 8px;
    padding: 12px 14px;
    border-radius: 14px;
  }

  .toolbar h2 {
    font-size: 1.2rem;
  }

  .toolbar p {
    font-size: .76rem;
    line-height: 1.35;
  }

  .main-grid {
    gap: 8px;
  }

  .input-panel,
  .output-panel {
    padding: 14px;
    border-radius: 14px;
  }

  /* On a phone the model cage match is the useful part; show it before the long source data. */
  .output-panel {
    grid-row: 1;
  }

  .input-panel {
    grid-row: 2;
  }

  .section-title {
    gap: 9px;
    margin-bottom: 4px;
  }

  .section-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
    font-size: 1rem;
  }

  .section-title h2 {
    font-size: 1.08rem;
  }

  .section-title p {
    font-size: .78rem;
    line-height: 1.35;
  }

  .model-stack {
    gap: 10px;
    margin-top: 12px;
  }

  .model-card {
    border-radius: 12px;
  }

  .model-head {
    align-items: flex-start;
    padding: 12px 12px 8px;
    min-width: 0;
  }

  .model-identity {
    gap: 8px;
  }

  .provider-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: .82rem;
  }

  .model-name {
    max-width: none;
    font-size: .88rem;
    overflow-wrap: anywhere;
  }

  .model-identity > div:last-child {
    min-width: 0;
  }

  .provider-name {
    margin-top: 3px;
    padding: 2px 6px;
    font-size: .66rem;
  }

  .compliance {
    gap: 5px;
    flex: 0 0 auto;
    font-size: .7rem;
  }

  .compliance-dot {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
  }

  .model-copy {
    margin: 0 12px 10px;
    min-width: 0;
    min-height: 0;
    padding: 12px;
    font-size: .88rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .model-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0 12px 12px;
    font-size: .69rem;
  }

  .model-stat strong {
    font-size: .72rem;
  }

  .fairness-note {
    margin-top: 10px;
    padding: 10px 11px;
    font-size: .75rem;
  }

  .data-section {
    padding-top: 14px;
  }

  .data-section h3 {
    font-size: .9rem;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric {
    min-height: 64px;
    padding: 9px 5px;
  }

  .metric-label {
    font-size: .67rem;
  }

  .metric-value {
    margin-top: 4px;
    font-size: .78rem;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 520px;
    font-size: .76rem;
  }

  .output-panel,
  .model-stack,
  .model-card {
    min-width: 0;
    max-width: 100%;
  }

  th,
  td {
    padding: 8px;
  }

  .afd-preview {
    min-height: 105px;
    max-height: 150px;
    padding: 11px;
    font-size: .75rem;
  }

  .details-box summary {
    padding: 10px 11px;
    font-size: .8rem;
  }

  pre {
    max-height: 300px;
    padding: 11px;
    font-size: .72rem;
  }

  .history-panel {
    margin-top: 8px;
    padding: 13px 14px;
    border-radius: 14px;
  }

  .history-heading {
    flex-direction: row;
    align-items: center;
  }

  .history-heading h2 {
    font-size: 1rem;
  }

  .history-heading p {
    font-size: .74rem;
  }

  .secondary-button {
    padding: 8px 10px;
    font-size: .78rem;
    white-space: nowrap;
  }

  .history-strip {
    gap: 7px;
    margin-top: 9px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .history-button {
    min-width: 92px;
    padding: 8px 9px;
    scroll-snap-align: start;
  }

  .footer {
    padding-top: 12px;
    font-size: .68rem;
    line-height: 1.4;
  }
}

@media (max-width: 390px) {
  .shell {
    width: calc(100% - 12px);
  }

  .brand p {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-name {
    max-width: none;
  }

  .model-stats {
    grid-template-columns: 1fr 1.4fr .9fr;
  }
}



.brand-app-icon {
  object-fit: cover;
  padding: 0;
}


/* AbaWeather Labs project index */
.labs-home .site-header {
  padding-bottom: 8px;
}

.labs-index {
  padding-top: 18px;
}

.labs-intro {
  padding: 24px 26px;
  margin-bottom: 14px;
}

.labs-intro h2,
.labs-intro p {
  margin: 0;
}

.labs-intro h2 {
  font-size: 1.45rem;
}

.labs-intro p {
  margin-top: 7px;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}

.project-card {
  display: block;
  padding: 24px 26px;
  color: var(--ink);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 121, 255, .35);
  box-shadow: 0 18px 40px rgba(18, 48, 86, .2);
}

.project-card:focus-visible {
  outline: 3px solid rgba(20, 121, 255, .45);
  outline-offset: 3px;
}

.project-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--blue-dark);
  background: var(--soft-blue);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.project-card h2,
.project-card p {
  margin: 0;
}

.project-card h2 {
  font-size: 1.3rem;
}

.project-card p {
  margin-top: 8px;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

.project-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--blue-dark);
  font-weight: 750;
}

@media (max-width: 720px) {
  .labs-index {
    padding-top: 8px;
  }

  .labs-intro,
  .project-card {
    padding: 18px;
    border-radius: 14px;
  }

  .labs-intro h2 {
    font-size: 1.2rem;
  }
}


.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.footer-nav a {
  color: inherit;
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.footer-nav a:hover {
  color: white;
}
