:root {
  color-scheme: light;
  --canvas: #f5f7f6;
  --paper: #fff;
  --ink: #202734;
  --muted: #535e6b;
  --edge: #d9dce4;
  --accent: #a32340;
  --accent-dark: #7c1830;
  --focus: #0b63a2;
  --deep: #14343b;
  --teal: #216455;
  font: 100%/1.55 system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

main, .site-header nav {
  width: min(74rem, 100% - 2rem);
  margin-inline: auto;
}

main { padding-block: 1.75rem 3rem; }

a { color: var(--accent-dark); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: absolute;
  z-index: 1;
  background: var(--paper);
  padding: .5rem 1rem;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--edge);
}

.site-header nav, .toolbar, .section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
}

.site-header nav { min-height: 4rem; padding-block: .7rem; }
.site-header form { margin: 0; }
.site-header .brand { margin-inline-end: auto; color: var(--ink); font-weight: 800; }
.site-header nav > a { text-decoration: none; }
.site-header nav > a:not(.brand) { padding: .3rem .5rem; border-radius: .4rem; }
.site-header nav > a[aria-current], .site-header nav > a:hover:not(.brand) { background: #e5f0ed; color: var(--deep); }

.brand span {
  display: inline-block;
  vertical-align: middle;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid var(--deep);
  background:
    radial-gradient(circle, white 18%, var(--deep) 21% 32%, transparent 34%),
    linear-gradient(var(--accent) 43%, var(--deep) 44% 56%, white 57%);
}

.account-menu { position: relative; margin: 0; }
.account-menu > summary { margin: 0; }
.account-menu > div {
  position: absolute;
  inset-inline-end: 0;
  z-index: 2;
  display: grid;
  gap: .55rem;
  min-width: 11rem;
  padding: .75rem;
  border: 1px solid var(--edge);
  border-radius: .65rem;
  background: var(--paper);
  box-shadow: 0 .45rem 1rem #14343b22;
}

h1, h2 { line-height: 1.15; margin-block: .2em .35em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: 1.25rem; }
p { margin-block: .35rem .85rem; }
.section-heading { justify-content: space-between; margin-bottom: 1rem; }
.muted, .eyebrow { color: var(--muted); }
.eyebrow { font-size: .8rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.panel, .notice {
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: .85rem;
  padding: 1rem;
  margin-block: 0 1rem;
}

.notice { border-inline-start: .35rem solid var(--focus); }
.notice.error { border-inline-start-color: var(--accent); }
.narrow { max-width: 40rem; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.card-grid, .field-grid { display: grid; gap: 1rem; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin-block: 1rem; }
.card-grid > .panel { margin: 0; }
.field-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.field-grid .wide { grid-column: 1 / -1; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, summary { font-weight: 700; }
summary { cursor: pointer; }
details[open] > summary { margin-bottom: .75rem; }
.stack { display: grid; gap: .8rem; align-content: start; }
.filters { align-items: end; }
.specimen { display: flex; gap: .8rem; align-items: center; min-width: 0; }
.sprite { flex: none; border-radius: .7rem; background: #eff1f6; object-fit: contain; }
.tabs { margin-bottom: 1rem; }
.tabs a { padding: .4rem .7rem; }
.tabs [aria-current] { border-bottom: 3px solid var(--accent); font-weight: 750; }
.layout-switch { margin-bottom: 1rem; }
.layout-switch [aria-current] { background: var(--accent); color: white; }
.layout-switch [aria-current]:hover { background: var(--accent-dark); color: white; }
.panel.table-responsive { position: relative; }
.panel.table-responsive > .table { margin-bottom: 0; }
.table-specimen .sprite { width: 44px; height: 44px; }
.table-dex-actions[open] { min-width: 13rem; }
.pagination { margin-block: 1rem; }

.badge {
  display: inline-block;
  border-radius: 2rem;
  background: #edf0f5;
  color: #343f53;
  font-size: .82rem;
  font-weight: 650;
  padding: .15rem .55rem;
}

.badge.shiny { background: #faedb8; color: #664000; }
.badge.good { background: #dbeee6; color: #194d3f; }
.badge.type-badge { background: #e7eef8; color: #30496c; }

form label > input:not([type="checkbox"]), .field > select, form label > textarea {
  display: block;
  width: 100%;
  margin-block-start: .3rem;
}

input:not([type="checkbox"]), select, textarea {
  max-width: 100%;
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 1px solid #9099a6;
  border-radius: .45rem;
  padding: .45rem .6rem;
}

input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: .45rem; }
textarea { resize: vertical; }

.button, button {
  display: inline-block;
  font: inherit;
  font-weight: 675;
  color: white;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: .5rem;
  padding: .48rem .8rem;
  text-decoration: none;
  cursor: pointer;
}

.button:hover, button:hover { background: var(--accent-dark); }
.button.secondary, button.secondary { background: var(--paper); color: var(--accent-dark); }
.button.secondary:hover, button.secondary:hover { background: #faedf0; }
button.danger { background: var(--accent-dark); }

.hero {
  padding: clamp(1.35rem, 5vw, 3rem);
  margin-block-end: 1.35rem;
  border-radius: 1rem;
  color: white;
  background: radial-gradient(ellipse at 100% 0%, #286959, transparent 65%), var(--deep);
}
.hero .eyebrow { color: #8ce0cb; }
.hero p { max-width: 42rem; }
.hero .button.secondary { color: var(--deep); border-color: transparent; }
.hero :focus-visible { outline-color: #8ce0cb; }
.welcome { padding-block: clamp(2rem, 10vw, 6rem); }
.scope-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: end;
}
.scope-picker {
  border: 1px solid var(--edge);
  border-radius: .55rem;
  padding: .55rem .65rem;
  min-width: 0;
}
.scope-picker fieldset { max-height: 14rem; overflow: auto; }
.scope-picker label { align-items: start; margin-bottom: .3rem; overflow-wrap: anywhere; }
.scope-picker input { flex: none; }
.stat-card { height: 100%; border-top: .25rem solid var(--teal); margin-block: 0; }
.stat-number { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 780; line-height: 1.1; }
.goal-panel progress { display: block; width: 100%; height: .8rem; accent-color: var(--teal); }
.data-list { padding: 0; margin-block: .75rem 0; list-style: none; }
.data-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .65rem;
  padding: .65rem 0;
  border-top: 1px solid var(--edge);
  overflow-wrap: anywhere;
}
.data-list time { color: var(--muted); }
.browse-layout { display: grid; gap: 1rem; align-items: start; }
.browse-results { min-width: 0; }
.filter-panel, .filter-panel .field { min-width: 0; }
.dex-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.dex-card { display: grid; align-content: start; gap: .8rem; }
.dex-card .sprite { background: #e8f2ee; }
.dex-card .specimen p { margin-block-end: .2rem; }
.entry-status { gap: .35rem; align-items: baseline; }
.entry-actions { border-top: 1px solid var(--edge); padding-top: .45rem; }
.empty-state { grid-column: 1 / -1; }
.form-sprites { margin-top: .85rem; }
.form-sprites figure { margin: 0; text-align: center; }
.form-sprites figcaption { color: var(--muted); font-size: .86rem; }

@media (min-width: 60rem) {
  .browse-layout { grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr); }
}
