/* App-specific overrides on top of Pico */
:root {
  --pico-font-size: 100%;
}

main.container {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

nav.app-nav {
  border-bottom: 1px solid var(--pico-muted-border-color);
  margin-bottom: 1.5rem;
}

nav.app-nav ul {
  margin: 0;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1rem;
}

.flash.error {
  background: var(--pico-del-color, #ffe0e0);
  color: #7a0000;
}

.flash.info {
  background: var(--pico-ins-color, #e0f0ff);
}

.score-breakdown {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.theme-toggle {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1000;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.in-stock-badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}
.in-stock-badge.yes { background: var(--pico-ins-color, #1a7f37); color: #fff; }
.in-stock-badge.no  { background: var(--pico-del-color, #82282e); color: #fff; }

table.batches td, table.batches th { vertical-align: middle; }
table.batches .terps { font-size: 0.85rem; color: var(--pico-muted-color); }

.row-list .row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.25rem;
}
.row-list label { margin: 0; }

.matches details.match {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
}
.matches summary { cursor: pointer; list-style: none; }
.matches summary::-webkit-details-marker { display: none; }
.match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.match-meta {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}
.match-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 8rem;
  justify-content: flex-end;
}
.score-num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
}
.score-bar {
  display: inline-block;
  width: 6rem;
  height: 0.5rem;
  background: var(--pico-muted-border-color);
  border-radius: 999px;
  overflow: hidden;
}
.score-bar-fill {
  display: block;
  height: 100%;
  background: var(--pico-primary);
}
.match-reasons {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}
.score-breakdown table {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.score-breakdown th { text-align: left; font-weight: normal; }
.score-breakdown td { text-align: right; font-variant-numeric: tabular-nums; }

.visit-logged {
  background: var(--pico-ins-color, #1a7f37);
  color: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: var(--pico-border-radius);
  margin: 0 0 1rem;
}
.visit-logged .feedback-link {
  display: inline-block;
  background: rgba(0,0,0,0.25);
  padding: 0.1rem 0.4rem;
  border-radius: var(--pico-border-radius);
  margin: 0 0.4rem;
  user-select: all;
}
.visit-logged a {
  color: #fff;
  text-decoration: underline;
}
