/* ARC Raiders: shared tokens, component states, then consolidated responsive rules. */
:root {
  color-scheme: dark;
  --bg: #0c0a12;
  --surface: #e8dece;
  --surface-alt: #ddd3bc;
  --ink: #130918;
  --light: #ece2d0;
  --muted: #b8afbf;
  --accent: #f1aa1c;
  --line: #3a3342;
  --danger: #a12730;
  --green: #28613a;
  --font: 'Barlow',system-ui,sans-serif;
  --display: 'Rajdhani','Barlow',sans-serif;
  --radius: 10px;
  --ease-out: cubic-bezier(.23,1,.32,1);
  --detail-width: 480px;
  --accent-hover: #ffc857;
  --success-hover: #347447;
  --danger-hover: #73303b;
  --ink-muted: #625566;
  --line-light: #c4b8a6;
  --field: #f5eddf;
}

*,*::before,*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  scroll-padding-bottom: 12px;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--light);
  font: 16px/1.5 var(--font);
}

button,input,select {
  font: inherit;
  min-height: 44px;
  border-radius: 6px;
}

button,a,input,select,summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  padding: 9px 15px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  line-height: 1.25;
  transition: background-color 140ms ease,transform 120ms var(--ease-out),box-shadow 180ms ease;
}

button:hover:not(:disabled) {
  background: var(--button-hover,var(--accent-hover));
}

button:active:not(:disabled) {
  transform: scale(.98);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

button.secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

button.secondary:hover:not(:disabled) {
  background: rgb(127 127 127 / .12);
}

button.danger-button {
  --button-hover: var(--danger-hover);
  background: #892b36;
  color: #fff;
  border-color: #892b36;
}

button.icon-button {
  --button-hover: rgb(127 127 127 / .12);
  width: 44px;
  flex-shrink: 0;
  padding: 8px;
  background: transparent;
  color: inherit;
  border-color: transparent;
  font-size: 1.7rem;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  vertical-align: middle;
}

:focus-visible {
  outline: 3px solid #236bca;
  outline-offset: 3px;
}

.nav :focus-visible,.masthead :focus-visible {
  outline-color: var(--accent);
}

input,select {
  width: 100%;
  padding: 8px 11px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid #766c79;
}

input[type=checkbox] {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: #895d00;
}

input[type=search]::-webkit-search-cancel-button {
  cursor: pointer;
}

label {
  display: grid;
  gap: 5px;
  font-size: .875rem;
  font-weight: 600;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

label.grow {
  flex: 1 1 220px;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

.panel a:hover {
  color: #6c4700;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  font-family: var(--display);
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.5rem,4.5vw,4rem);
  font-weight: 700;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.35rem;
}

p {
  max-width: 78ch;
}

svg {
  flex-shrink: 0;
}

[hidden] {
  display: none!important;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 100;
  background: var(--accent);
  color: var(--ink);
  padding: 12px;
}

.skip-link:focus {
  top: 8px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  padding: 6px max(20px,calc((100vw - 1460px)/2));
  background: #14101a;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
  font: 700 1.4rem var(--display);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  padding: 10px 14px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-links a[aria-current=location] {
  background: #30251a;
  color: #ffd17a;
  box-shadow: inset 0 -2px var(--accent);
}

.nav-links a:hover {
  background: #312534;
}

.masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: calc(100% - 40px);
  max-width: 1420px;
  margin: 18px auto 24px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(300px,1fr);
  gap: 14px 36px;
  align-items: center;
  border: 1px solid #706576;
  border-radius: 10px;
  background: #211b27;
}

.masthead::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(90deg,rgb(19 9 24 / .72),rgb(19 9 24 / .6) 45%,rgb(19 9 24 / .88)),url('https://sht-vod.dn.nexoncdn.co.kr/arcraiders/app-assets/img_sub_news_bg.DsOqfZtC.jpg');
  background-size: cover;
  background-position: center;
}

.masthead::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg,#3ab4f0 25%,#4ade80 25% 50%,#f1aa1c 50% 75%,#ef4444 75%);
}

.brand-note {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.masthead p:not(.brand-note) {
  color: #ded5e4;
  margin-top: 10px;
}

.rotation {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 16px;
  text-align: left;
  max-width: 550px;
  font-size: .875rem;
}

.rotation strong {
  grid-column: 2;
  grid-row: 1/3;
  font: 700 2.4rem/1.1 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--light);
  min-width: 5ch;
  text-align: right;
}

#next-event-label {
  grid-column: 1;
  font-size: .875rem;
  color: #ded5e4;
  max-width: 48ch;
  min-height: 3em;
}

.changelog {
  grid-column: 2;
  grid-row: 1/3;
  align-self: start;
  min-width: 0;
  padding: 0 14px;
  font-size: .875rem;
  background: rgb(12 10 18 / .64);
  border: 1px solid #64586c;
  border-radius: 8px;
}

.changelog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#changelog-title {
  font: 700 1.2rem var(--display);
  margin-right: auto;
}

#release-version {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.changelog-content {
  min-width: 0;
  padding-bottom: 10px;
}

.changelog ul {
  padding-left: 18px;
  color: #e1d8e6;
  margin: 6px 0;
}

.changelog li+li {
  margin-top: 4px;
}

.masthead .release-date {
  font-size: .75rem;
  color: #c1b5ca;
  margin-top: 8px;
}

.release {
  border-top: 1px solid #64586c;
  margin-top: 12px;
  padding-top: 12px;
}

.release h3 {
  font-size: 1rem;
}

.changelog-history summary {
  font-weight: 600;
  color: var(--accent);
}

main {
  max-width: 1460px;
  margin: auto;
  padding: 0 20px;
}

main>section {
  margin-bottom: 30px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading p {
  font-size: .9rem;
  color: var(--muted);
  margin-top: 5px;
}

.section-heading .actions {
  flex-shrink: 0;
}

.panel {
  background: var(--surface);
  color: var(--ink);
  padding: 22px;
  border-radius: var(--radius);
  color-scheme: light;
}

.panel .section-heading p,.panel .hint {
  color: #574b59;
}

.panel.is-empty {
  padding: 12px 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--light);
  color-scheme: dark;
}

.panel.is-empty .section-heading {
  margin-bottom: 4px;
  gap: 8px 16px;
}

.panel.is-empty h2 {
  font-size: 1.25rem;
}

.panel.is-empty .section-heading p,.panel.is-empty .empty {
  color: var(--muted);
  font-size: .875rem;
  margin: 0;
  padding: 0;
}

.panel.is-empty button {
  font-size: .875rem;
  flex-shrink: 0;
}

.map-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-bottom: 12px;
}

.map-selection p {
  font-weight: 600;
}

.profile-label {
  color: var(--accent);
  font-weight: 600;
  font-size: .95rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.filters label:first-child {
  flex: 1;
  min-width: 170px;
}

.filters label {
  min-width: 140px;
}

.maps-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
}

.map-card {
  container-type: inline-size;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  color-scheme: light;
}

.map-head {
  padding: 12px 18px;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-light);
}

.map-head.active {
  box-shadow: inset 3px 0 var(--accent);
}

.map-head h3 {
  font-size: 1.45rem;
}

.missing-count {
  font-size: .875rem;
  font-weight: 600;
}

.map-body {
  padding: 16px;
}

.current-events {
  position: relative;
  min-height: 110px;
  background: #211827;
  color: var(--light);
  padding: 14px;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.hero-image {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  opacity: .2;
}

.current-events>*:not(.hero-image) {
  position: relative;
}

.current-label {
  font-size: .875rem;
  color: #d5c8da;
}

.current-events .quiet {
  color: #d5c8da;
}

.event-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.event-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.current-events time {
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #c8bdaf;
}

.slot-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: .95rem;
}

.slot-time small {
  display: block;
  font-size: .875rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.slot-events {
  min-width: 0;
}

.slot-event {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.slot-event+.slot-event {
  margin-top: 7px;
}

.slot-event-name {
  font-size: .9rem;
  flex: 1;
  min-width: 75px;
  overflow-wrap: anywhere;
}

.remind-button {
  background: transparent;
  color: #4d3657;
  font-size: .875rem;
  border: 1px solid #a89aad;
  padding: 7px;
  min-height: 44px;
}

.remind-button[aria-pressed=true] {
  background: #f7d78d;
  border-color: #815600;
  color: #543900;
}

.reminder-icon {
  display: none;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.quiet {
  font-size: .875rem;
  color: var(--ink-muted);
}

.blueprint-section {
  border-top: 2px solid var(--line-light);
  padding-top: 14px;
}

.blueprint-section>summary {
  font-weight: 700;
  font-size: .95rem;
}

.blueprint-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.blueprint-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 6px;
  background: #d9cebd;
  padding: 8px;
  border-radius: 6px;
  border-left: 3px solid transparent;
}

.blueprint-row.missing {
  border-left-color: #a87300;
}

.blueprint-open {
  min-width: 0;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 9px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: .95rem;
}

.blueprint-open:hover:not(:disabled) {
  background: transparent;
  text-decoration: underline;
}

.item-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: #3a3546;
}

.blueprint-name {
  display: block;
  overflow-wrap: anywhere;
}

.blueprint-meta {
  font-size: .875rem;
  line-height: 1.5;
  color: #594961;
  font-weight: 500;
  margin-top: 3px;
}

.pin-button {
  background: transparent;
  color: #69596e;
  padding: 8px;
  font-size: 1.35rem;
  align-self: start;
}

.pin-button[aria-pressed=true] {
  color: #815600;
  background: #f7d78d;
}

.blueprint-detail {
  grid-column: 1/-1;
  font-size: .875rem;
}

.blueprint-detail summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.blueprint-detail summary::before,.changelog-heading::before {
  content: '';
  width: .5em;
  height: .5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  flex-shrink: 0;
}

.blueprint-detail[open]>summary::before,.changelog[open]>.changelog-heading::before {
  transform: rotate(45deg);
}

.blueprint-detail summary::-webkit-details-marker,.changelog-heading::-webkit-details-marker {
  display: none;
}

.blueprint-detail dl {
  margin: 4px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
}

.blueprint-detail dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.confidence {
  font-weight: 600;
  color: #365338;
}

.confidence.weak {
  color: #765010;
}

.trend {
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

.more-blueprints {
  margin-top: 8px;
}

.more-blueprints>summary {
  padding: 8px 0;
  font-size: .875rem;
  font-weight: 600;
}

.recommendations {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) repeat(2,minmax(0,1fr));
  gap: 14px;
}

.recommendations>.empty {
  grid-column: 1/-1;
  align-self: start;
}

.recommendation {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 8px;
  background: #201927;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 8px;
}

.recommendation h3 {
  font-size: 1.55rem;
}

.recommendation p {
  color: var(--muted);
  font-size: .9rem;
}

.recommendation .chips {
  margin-top: 4px;
  margin-bottom: 4px;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  min-height: 44px;
  padding: 6px 9px;
  font-size: .875rem;
  background: #3b3043;
  color: var(--light);
  font-weight: 500;
}

.chip:hover:not(:disabled) {
  background: #574462;
  color: #fff;
}

.frequency {
  margin-top: 18px;
}

summary {
  cursor: pointer;
  min-height: 44px;
  padding-block: 7px;
}

summary:hover {
  color: #8a5900;
}

.changelog summary:hover {
  color: var(--accent);
}

.frequency-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
  margin: 12px 0;
}

.frequency-row {
  border-top: 1px solid #beafbf;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.frequency-row strong {
  font-size: .875rem;
}

.frequency-row small {
  display: block;
  font-size: .875rem;
  color: var(--ink-muted);
}

.frequency-number {
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.reminder-panel .section-heading {
  align-items: start;
}

.reminder-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid #c6b8c3;
}

.reminder-row p {
  font-size: .875rem;
}

.trial-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
  margin-top: 12px;
}

.trial {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #bbafbd;
  padding: 12px;
  border-radius: 6px;
}

.trial.done {
  background: #d6dfc9;
  border-color: #7b9568;
}

.trial-content {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: .95rem;
}

.trial-content small {
  display: block;
  color: #635466;
  font-size: .875rem;
  font-weight: 400;
  margin-top: 4px;
}

.trial-toggle {
  background: transparent;
  border: 2px solid #77677d;
  width: 44px;
  padding: 0;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.trial-toggle[aria-pressed=true] {
  --button-hover: var(--success-hover);
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.upcoming {
  margin-top: 18px;
}

.upcoming .trial {
  background: #ddd2c4;
}

.search-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.search-form label {
  flex: 1;
}

.history {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
  font-size: .85rem;
}

.history .chip {
  color: var(--ink);
  background: #d4c8b9;
}

.item-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 14px;
  flex-wrap: wrap;
}

.item-summary img {
  width: 64px;
  height: 64px;
}

.item-summary h3 {
  font-size: 1.9rem;
}

.item-summary p {
  color: var(--ink-muted);
  font-size: .9rem;
}

.item-summary .actions {
  margin-left: auto;
}

.search-more {
  margin-top: 16px;
}

.collection-setup {
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: .9rem;
}

.collection-setup>summary {
  width: fit-content;
}

.collection-setup>summary:hover,.recommendation-more>summary:hover {
  color: var(--accent);
}

.collection-setup .actions {
  padding: 8px 0;
}

.recommendation-more {
  min-width: 0;
}

.recommendation-more>summary {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #8e7b98;
  border-radius: 6px;
  font-size: .875rem;
}

.recommendation-more[open] {
  flex-basis: 100%;
}

.recommendation-more>.chips {
  margin-top: 8px;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin-top: 18px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #d9cebd;
  font-weight: 500;
  color: var(--ink);
}

.votes-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
  margin: 16px 0;
}

.vote-group {
  border: 1px solid #c4b8c2;
  border-radius: 6px;
  padding: 14px;
}

.vote-group h4 {
  margin: 0 0 8px;
  font-size: .95rem;
}

.vote-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #cabfc7;
  padding: 6px 0;
  font-size: .9rem;
}

.vote-row span:last-child {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.nearest {
  border-top: 1px solid #c4b8c2;
  padding-top: 16px;
  margin-top: 16px;
}

.nearest h4 {
  margin: 0 0 10px;
}

.nearest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: .9rem;
}

.nearest-more>summary {
  font-weight: 600;
  font-size: .9rem;
}

.item-actions {
  margin: 18px 0 12px;
}

.profile-picker {
  min-width: 180px;
}

.tracker-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
  font-size: .875rem;
}

progress {
  width: 180px;
  height: 10px;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  accent-color: #6f4a00;
  background: #c9bdaf;
}

progress::-webkit-progress-bar {
  background: #c9bdaf;
}

progress::-webkit-progress-value {
  background: #936300;
}

.tracker-controls {
  display: flex;
  align-items: end;
  gap: 18px;
  flex-wrap: wrap;
}

.tracker-actions {
  margin: 12px 0;
  align-items: start;
}

.tracker-list {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  padding: 4px;
}

.tracker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #d7ccbc;
  border-radius: 6px;
  min-width: 0;
}

.tracker-row.owned {
  background: #dae0cc;
}

.tracker-row .blueprint-open {
  flex: 1;
  font-size: .9rem;
  min-width: 0;
}

.owned-toggle {
  min-width: 67px;
  padding: 8px;
  background: #f5ead7;
  border: 1px solid #95869a;
  font-size: .875rem;
}

.owned-toggle[aria-pressed=true] {
  --button-hover: var(--success-hover);
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.empty {
  padding: 20px 4px;
  color: inherit;
  opacity: .85;
  font-size: .95rem;
  grid-column: 1/-1;
}

.empty button {
  margin-top: 12px;
  display: block;
}

.notice {
  padding: 16px;
  border: 1px solid #936b2c;
  border-radius: 6px;
  background: #3b2d18;
  color: #ffdf9c;
  margin-bottom: 18px;
}

.notice.danger {
  background: #45212d;
  color: #ffe0e3;
  border-color: #a56276;
}

.notice p {
  margin-bottom: 10px;
}

.connection-status {
  color: var(--muted);
  font-size: .875rem;
  margin-bottom: 12px;
}

.freshness.stale {
  color: #965b0b;
}

.section-heading .freshness.stale {
  color: #dca75b;
}

.panel .section-heading .freshness.stale {
  color: #855207;
}

.error-box {
  border-left: 3px solid var(--danger);
  padding: 12px;
  background: #efcfc6;
  color: #672329;
  margin: 12px 0;
}

.error-box button {
  margin-left: 10px;
}

.hint {
  font-size: .85rem;
  color: var(--muted);
  margin: 10px 0;
}

footer {
  max-width: 1460px;
  margin: auto;
  padding: 6px 20px 35px;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.8;
}

dialog {
  width: min(650px,calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 26px;
  color-scheme: light;
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgb(5 3 10 / .78);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

dialog p {
  margin: 12px 0;
}

dialog label {
  margin: 10px 0;
}

dialog h3 {
  margin: 16px 0 8px;
}

dialog hr {
  border: 0;
  border-top: 1px solid #bdafbe;
  margin: 22px 0;
}

.dialog-form {
  display: flex;
  gap: 10px;
  align-items: end;
}

.dialog-form label {
  flex: 1;
  min-width: 0;
}

.dialog-form button {
  margin-bottom: 10px;
}

dialog .hint {
  color: var(--ink-muted);
}

#pair-code {
  font: 14px/1.5 ui-monospace,monospace;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px,calc(100% - 32px));
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  background: #31263a;
  color: #fff;
  border: 1px solid #bc8b31;
  border-radius: 8px;
  box-shadow: 0 8px 30px #0006;
  z-index: 100;
  font-size: .95rem;
  animation: feedback-in 160ms var(--ease-out);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.nav-links svg {
  display: none;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.masthead h1 {
  font-size: clamp(2.2rem,3.4vw,3rem);
}

.text-button {
  padding: 2px 0;
  min-height: 44px;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: .875rem;
}

.text-button:hover:not(:disabled) {
  background: transparent;
  color: var(--accent);
}

.connection-status:empty {
  display: none;
}

.map-next {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 0;
}

.map-next .current-label {
  color: var(--ink-muted);
}

.map-next time {
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}

.map-next strong {
  grid-column: 1/-1;
  font-weight: 600;
  font-size: .95rem;
}

.map-schedule {
  border-top: 1px solid var(--line-light);
  margin-bottom: 8px;
}

.map-schedule>summary {
  font-weight: 600;
  font-size: .95rem;
}

.map-schedule[open]>summary {
  margin-bottom: 8px;
}

.recommendation-primary {
  border-color: #ad7b29;
  background: #28202b;
  box-shadow: inset 3px 0 var(--accent);
}

.recommendation-label {
  font-size: .875rem;
  color: var(--muted);
}

.recommendation-primary .recommendation-label {
  color: #ffd17a;
}

.recommendation-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.recommendation-title>span {
  font-weight: 600;
  font-size: .95rem;
}

.recommendation .recommendation-reason {
  color: var(--light);
}

.map-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #8e7b98;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin-top: auto;
  transition: background-color 140ms ease,transform 120ms var(--ease-out);
}

.primary-action {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}

.primary-action:hover {
  color: var(--ink);
  background: #ffc857;
}

.map-action:active {
  transform: scale(.98);
}

.tracker-views {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tracker-views button {
  padding: 9px 12px;
  transition: transform 120ms var(--ease-out);
}

.tracker-views button[aria-pressed=true],.tracker-views button[aria-pressed=true]:hover:not(:disabled) {
  background: var(--ink);
  color: var(--light);
  border-color: var(--ink);
}

.tracker-management {
  border: 1px solid #8e8193;
  border-radius: 6px;
  min-width: 160px;
}

.tracker-management>summary {
  padding: 10px 14px;
  font-weight: 600;
  line-height: 1.25;
}

.tracker-management>summary:hover {
  color: var(--ink);
  background: var(--surface-alt);
}

.tracker-profile-label {
  color: var(--ink-muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.tracker-management .profile-picker {
  margin: 12px;
  min-width: 0;
  width: auto;
}

.management-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border-top: 1px solid #baadbb;
}

.tracker-row .pin-button {
  width: 44px;
  min-width: 44px;
  align-self: center;
}

.tracker-row .item-icon {
  width: 36px;
  height: 36px;
}

.tracker-row .owned-toggle {
  min-width: 67px;
}

.just-saved {
  box-shadow: 0 0 0 3px #608347;
  transition: box-shadow 180ms ease;
}

@keyframes feedback-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

dialog[open] {
  animation: feedback-in 180ms var(--ease-out);
}

.item-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: var(--detail-width);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100%;
  border-radius: 0;
  border-left: 1px solid #bbafbd;
  padding: 0 22px 28px;
  z-index: 30;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: -12px 0 35px #0003;
}

.item-detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 0;
  background: var(--surface);
  border-bottom: 1px solid #c4b8c2;
}

.item-detail-head h2 {
  font-size: 1.4rem;
}

.item-dialog .votes-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.item-dialog .item-summary .actions {
  margin-left: 0;
}

.item-dialog .nearest-row {
  flex-wrap: wrap;
}

.item-dialog .item-summary h3 {
  overflow-wrap: anywhere;
}

.item-dialog .item-summary {
  align-items: start;
}

.item-dialog .item-summary>div:not(.actions) {
  flex: 1;
  min-width: 0;
}

html[data-input=keyboard] {
  scroll-behavior: auto;
}

html[data-input=keyboard] *,html[data-input=keyboard] *::before,html[data-input=keyboard] *::after {
  animation: none!important;
  transition: none!important;
}

html[data-input=keyboard] button:active {
  transform: none;
}

#recommendations {
  min-height: 220px;
}

#recommendations[aria-busy=true] {
  min-height: 310px;
}

#maps-grid[aria-busy=true] {
  min-height: 740px;
}

.freshness {
  min-height: 1.5em;
}

#maps-grid:has(>.map-card:only-child) {
  grid-template-columns: 1fr;
}

@container(min-width:700px) {
  .map-body {
    display: grid;
    grid-template-columns: minmax(260px,1fr) minmax(0,1.4fr);
    gap: 24px;
    align-items: start;
  }

  .map-overview:only-child {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: minmax(260px,1fr) minmax(0,1.4fr);
    gap: 0 24px;
    align-items: start;
  }

  .map-overview:only-child .map-next {
    grid-column: 1;
  }

  .map-overview:only-child .map-schedule {
    grid-column: 2;
    grid-row: 1/3;
  }
}

@media(min-width:761px) and (max-width:1100px) {
  .recommendations:has(>.recommendation:nth-child(2):last-child)>.recommendation:last-child {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(220px,1fr);
    column-gap: 24px;
  }

  .recommendations:has(>.recommendation:nth-child(2):last-child)>.recommendation:last-child>:not(.chips):not(.map-action) {
    grid-column: 1;
  }

  .recommendations:has(>.recommendation:nth-child(2):last-child)>.recommendation:last-child>.chips {
    grid-column: 2;
    grid-row: 1/4;
  }

  .recommendations:has(>.recommendation:nth-child(2):last-child)>.recommendation:last-child>.map-action {
    grid-column: 2;
    grid-row: 4/5;
    justify-self: start;
  }
}

@media(min-width:1600px) {
  .maps-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media(max-width:1100px) {
  .masthead {
    grid-template-columns: minmax(0,1fr) minmax(280px,1fr);
  }

  .maps-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .tracker-list,.result-list,.trial-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .recommendations {
    grid-template-columns: 1fr 1fr;
  }

  .recommendation-primary {
    grid-column: 1/-1;
  }

  .frequency-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media(min-width:1100px) {
  .item-detail-open {
    padding-right: var(--detail-width);
  }

  .item-detail-open .maps-grid,.item-detail-open .tracker-list {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .item-detail-open .masthead {
    grid-template-columns: 1fr;
  }

  .item-detail-open .changelog {
    grid-column: auto;
    grid-row: auto;
  }

  .item-detail-open .recommendations {
    grid-template-columns: 1fr;
  }

  .item-detail-open .nav {
    gap: 8px;
  }

  .item-detail-open .nav-links a {
    padding-inline: 7px;
  }

  .recommendations:has(>.recommendation:nth-child(2):last-child) {
    grid-template-columns: minmax(0,1.4fr) minmax(0,1fr);
  }

  .recommendations:has(>.recommendation:only-child) {
    grid-template-columns: 1fr;
  }

  body:not(.item-detail-open) .recommendation:only-child {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(280px,1fr);
    column-gap: 32px;
    align-content: center;
  }

  body:not(.item-detail-open) .recommendation:only-child>.recommendation-label,body:not(.item-detail-open) .recommendation:only-child>.recommendation-title,body:not(.item-detail-open) .recommendation:only-child>p {
    grid-column: 1;
  }

  body:not(.item-detail-open) .recommendation:only-child>.chips {
    grid-column: 2;
    grid-row: 1/4;
    align-self: center;
    justify-self: end;
    justify-content: flex-end;
  }

  body:not(.item-detail-open) .recommendation:only-child>.map-action {
    grid-column: 2;
    grid-row: 4/5;
    justify-self: end;
    align-self: end;
  }
}

@media(min-width:1100px) and (max-width:1340px) {
  .item-detail-open .brand span {
    display: none;
  }
}

@media(min-width:1100px) and (max-width:1200px) {
  .item-detail-open .tracker-list {
    grid-template-columns: 1fr;
  }
}

@media(max-width:1099px) {
  .item-dialog {
    width: 100%;
    border: 0;
    padding: 0 18px calc(24px + env(safe-area-inset-bottom));
    box-shadow: none;
  }

  .item-detail-open {
    overflow: hidden;
  }

  .item-detail-head {
    padding-top: max(14px,env(safe-area-inset-top));
  }
}

@media(max-width:760px) {
  .nav {
    gap: 6px;
    padding: 6px 14px;
    min-height: 56px;
  }

  .brand {
    flex: 1;
  }

  .nav-links {
    position: fixed;
    inset: auto 0 0;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 0;
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
    background: #14101a;
    border-top: 1px solid var(--line);
  }

  .nav-links a {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: .8rem;
    min-height: 50px;
  }

  .masthead {
    width: calc(100% - 28px);
    margin: 12px auto 20px;
    padding: 14px 16px;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .changelog {
    grid-column: auto;
    grid-row: auto;
    padding: 0 12px;
  }

  .masthead-title p {
    display: none;
  }

  .masthead h1 {
    font-size: 2.15rem;
  }

  .masthead p {
    font-size: .9rem;
  }

  .rotation {
    max-width: none;
    padding: 0;
    gap: 2px 12px;
  }

  .rotation strong {
    font-size: 2rem;
  }

  html {
    scroll-padding-top: 80px;
    scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  main {
    padding: 0 14px;
  }

  .section-heading {
    align-items: start;
    flex-wrap: wrap;
  }

  .filters {
    flex-wrap: wrap;
    gap: 12px;
  }

  .filters label {
    flex: 1;
    min-width: 120px;
  }

  .filters label:first-child {
    flex-basis: 100%;
  }

  .panel {
    padding: 18px;
  }

  .recommendations {
    grid-template-columns: 1fr;
  }

  .recommendation-primary {
    grid-column: auto;
  }

  .maps-grid {
    gap: 12px;
  }

  .tracker-list {
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
  }

  .votes-grid {
    grid-template-columns: 1fr;
  }

  .result-list {
    grid-template-columns: 1fr;
  }

  .trial-grid {
    grid-template-columns: 1fr;
  }

  .tracker-progress {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tracker-progress progress {
    width: 100%;
  }

  #tracker .section-heading {
    gap: 4px 12px;
    margin-bottom: 8px;
  }

  #tracker .section-heading h2 {
    font-size: 1.5rem;
  }

  .tracker-profile-label {
    align-self: end;
  }

  .reminder-row {
    flex-wrap: wrap;
  }

  .reminder-row .actions {
    width: 100%;
  }

  .section-heading h2 {
    font-size: 1.6rem;
  }

  .profile-picker {
    min-width: 160px;
  }

  .nav-links svg {
    display: block;
  }

  .nav-links a[aria-current=location] {
    box-shadow: inset 0 2px var(--accent);
  }

  .toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .item-dialog .toast {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .tracker-views {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
  }

  .tracker-views button {
    padding: 9px 4px;
    font-size: .875rem;
  }

  .tracker-controls {
    gap: 10px;
  }

  .tracker-management {
    flex: 1;
  }

  .tracker-management[open] {
    flex-basis: 100%;
  }

  .tracker-row {
    gap: 5px;
    padding: 8px 6px;
  }

  .recommendation {
    padding: 16px;
    gap: 6px;
  }

  .changelog .text-button {
    min-height: 44px;
  }

  .changelog li {
    line-height: 1.4;
  }

  .recommendation .chips {
    order: 2;
  }

  .recommendation .map-action {
    margin-top: 0;
  }

  .section-heading:has(>.profile-label) {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
  }

  .section-heading:has(>.profile-label)>div {
    display: contents;
  }

  .section-heading:has(>.profile-label) h2,.section-heading:has(>.profile-label) p:not(.freshness) {
    grid-column: 1/-1;
  }

  .section-heading:has(>.profile-label) .freshness {
    grid-column: 1;
  }

  .profile-label {
    grid-column: 2;
    grid-row: 3;
    font-size: .875rem;
    align-self: end;
  }
}

@media(max-width:520px) {
  .remind-button {
    width: 44px;
    min-width: 44px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .reminder-icon {
    display: block;
  }

  .reminder-label {
    display: none;
  }

  .masthead {
    grid-template-columns: 1fr;
  }

  .maps-grid {
    grid-template-columns: 1fr;
  }

  .frequency-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    font-size: 1.3rem;
  }

  .search-form,.dialog-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form label,.dialog-form label {
    flex: auto;
  }

  .dialog-form button {
    margin-bottom: 4px;
  }

  .tracker-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tracker-controls .grow {
    flex-basis: 100%;
  }

  dialog {
    padding: 18px;
  }

  .section-heading .actions {
    flex-shrink: 1;
  }

  .item-summary .actions {
    margin-left: 0;
  }

  .nearest-row {
    flex-wrap: wrap;
  }

  .profile-picker {
    width: 100%;
  }
}

@media(max-width:360px) {
  .tracker-views button {
    padding-inline: 2px;
    font-size: .8125rem;
  }
}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }

  *,*::before,*::after {
    transition: none!important;
    animation: none!important;
  }
}
