* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
}
body {
  margin: 0;
  background: var(--wine);
  color: var(--ink);
  font: 300 17px/1.5 var(--font-ui);
  text-rendering: optimizeLegibility;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}
button {
  border-radius: 0;
}
input,
select {
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--surface-sunk);
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  max-width: 100%;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ink-soft);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip {
  position: fixed;
  top: -100px;
  background: var(--ink);
  color: var(--wine);
  z-index: 10;
  padding: 1rem;
}
.skip:focus {
  top: 1rem;
}
header {
  display: flex;
  align-items: center;
  gap: 3rem;
  margin: 0 auto;
  padding: 1.1rem max(2rem, calc((100vw - 1280px) / 2));
  border-bottom: 1px solid var(--rule);
  min-height: 90px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  font: 300 1rem var(--font-data);
  letter-spacing: 0.04em;
}
.brand img {
  width: 34px;
  height: 42px;
}
.brand small {
  display: block;
  color: var(--ink-faint);
  font: 300 0.65rem var(--font-data);
  margin-top: 0.35rem;
}
.brand > span {
  min-width: 110px;
}
nav {
  display: flex;
  align-self: stretch;
  gap: 2rem;
}
.nav {
  border: 0;
  background: none;
  padding: 0 0.1rem;
  position: relative;
  color: var(--ink-faint);
}
.nav.active {
  color: var(--ink);
}
.nav.active:after {
  content: "";
  height: 1px;
  background: var(--ink);
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.1rem;
}
.nav span {
  font-size: 0.7rem;
  margin-left: 0.4rem;
}
header > .quiet {
  margin-left: auto;
}
main {
  max-width: 1280px;
  margin: auto;
  padding: 0 2rem;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 3.5rem 0 2.25rem;
}
.eyebrow,
.label,
.control label,
footer,
.stream {
  font-family: var(--font-data);
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.065em;
}
.eyebrow {
  color: var(--ink-soft);
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}
h1 {
  font-weight: 300;
  line-height: 0.95;
  font-size: clamp(3.5rem, 7vw, 6rem);
  letter-spacing: -0.04em;
  margin: 0;
}
h2 {
  font-weight: 300;
  font-size: 2rem;
  line-height: 1.15;
  margin: 0;
}
h3 {
  font-weight: 300;
}
.lede {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0.9rem 0 0;
}
.run-state {
  text-align: right;
}
.run-state p {
  font-size: 0.85rem;
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
}
.status i {
  width: 7px;
  height: 7px;
  background: var(--ink-faint);
  display: inline-block;
  border-radius: 50%;
}
.status.running i {
  background: var(--lamp-live);
  box-shadow: 0 0 0 4px #d3dcc81a;
}
.status.error i {
  background: var(--lamp-ban);
}
.controls {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1.15fr auto;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}
.control small {
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.control strong {
  font-weight: 300;
  font-size: 1.1rem;
}
.inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.inline input {
  width: 72px;
  min-height: 35px;
  padding: 0.25rem 0.5rem;
}
.control .label,
.control label {
  color: var(--ink-soft);
}
.button {
  border: 1px solid var(--rule-strong);
  background: none;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  white-space: nowrap;
}
.button:hover {
  background: var(--cobalt-soft);
}
.primary {
  background: var(--ink);
  color: var(--wine);
  border-color: var(--ink);
}
.primary:hover {
  background: #cbc1b9;
}
.quiet {
  background: none;
  border: 0;
  padding: 0.5rem 0;
  min-height: 38px;
  color: var(--ink-soft);
  text-underline-offset: 5px;
}
.quiet:hover {
  color: var(--ink);
  text-decoration: underline;
}
.country-toggle {
  align-self: flex-start;
  padding: 0;
  min-height: 26px;
  color: var(--ink);
}
.danger {
  color: var(--lamp-ban);
}
.destructive {
  background: var(--lamp-ban-soft);
  border-color: var(--lamp-ban);
}
fieldset {
  border: 1px solid var(--rule);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
fieldset legend {
  padding: 0 0.5rem;
}
fieldset p {
  color: var(--ink-faint);
  font-size: 0.85rem;
}
#country-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
}
#country-options label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
#country-options input {
  min-height: 0;
  accent-color: var(--ink);
}
.streams {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  margin: 1.25rem 0 0;
  gap: 5px;
}
.streams > p {
  grid-column: 1/-1;
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin: 0;
}
.stream {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 0.55rem;
  min-width: 0;
}
.stream strong {
  font-size: 0.65rem;
  font-weight: 300;
  color: var(--ink);
}
.stream[data-state="connected"] {
  border-top-color: var(--lamp-live);
}
.stream[data-state="banned"] {
  border-top-color: var(--lamp-ban);
  color: var(--lamp-ban);
}
.message {
  border-left: 2px solid var(--ink-faint);
  padding: 0.75rem 1rem;
  background: var(--surface);
  margin: 1rem 0;
  font-size: 0.95rem;
}
.collection {
  margin-top: 3rem;
}
.collection-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
}
.totals {
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin: 0;
}
.collection-totals {
  text-align: right;
}
.collection-description {
  color: var(--ink-faint);
  font-size: 0.85rem;
  max-width: 850px;
  margin: 0.75rem 0 0;
}
.filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding: 1.1rem 0;
  margin-top: 1.2rem;
}
.search {
  width: min(300px, 40%);
}
.search input {
  width: 100%;
}
.filters > .danger {
  margin-left: auto;
}
.peer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.7rem 1rem;
}
.peer-card {
  min-width: 0;
  border: 1px solid var(--rule);
  background: var(--surface-sunk);
}
.cover {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4/3;
  background: var(--stage);
  padding: 0;
  border: 0;
  width: 100%;
  overflow: hidden;
  text-decoration: none;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cover span {
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.peer-copy {
  padding: 0.9rem 1rem;
}
.peer-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.peer-country {
  color: var(--ink-soft);
  font-style: italic;
}
.peer-count {
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.peer-copy h3 {
  font-size: 1rem;
  overflow-wrap: anywhere;
  margin: 0.4rem 0 0.15rem;
}
.peer-copy p {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 0;
}
.card-actions {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  margin-top: 0.8rem;
  padding-top: 0.3rem;
  font-size: 0.85rem;
}
.empty {
  text-align: center;
  padding: 4rem 1rem 3rem;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.empty-mark {
  font-size: 3rem;
  color: var(--rule-strong);
}
.empty h3 {
  font-size: 1.7rem;
  margin: 1rem 0 0.5rem;
}
.empty p {
  font-size: 1rem;
  margin: 0;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
  font-size: 0.9rem;
  color: var(--ink-faint);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding: 1.6rem 0 2rem;
  color: var(--ink-faint);
  font-size: 0.6rem;
  margin-top: 3rem;
}
dialog {
  width: min(1120px, calc(100% - 2rem));
  max-height: calc(100dvh - 3rem);
  padding: 0 2rem 2rem;
  background: var(--wine);
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-float);
}
dialog::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(4px);
}
.dialog-top {
  display: flex;
  position: sticky;
  top: 0;
  justify-content: space-between;
  align-items: center;
  background: var(--wine);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  z-index: 1;
}
.dialog-top .eyebrow {
  margin: 0;
}
.detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.detail-heading p {
  color: var(--ink-soft);
}
.detail-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.encounter {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.encounter h3 {
  font-size: 1.15rem;
  margin: 0;
}
.encounter .meta {
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin: 0.4rem 0 1rem;
}
.frames {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.frames figure {
  margin: 0;
  min-width: 0;
}
.frames a {
  display: block;
  background: var(--stage);
}
.frames img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: contain;
}
.frames figcaption {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 0.3rem;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}
#confirm-dialog {
  max-width: 33rem;
  padding: 2rem;
}
.login-body {
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
}
.login-panel {
  width: min(100%, 430px);
  padding: 3rem 2rem;
}
.login-panel > img {
  display: block;
  margin-bottom: 2rem;
}
.login-panel h1 {
  font-size: 4rem;
}
.login-panel form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 2.5rem;
}
.login-panel form label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.login-panel form button {
  margin-top: 0.5rem;
}
@media (min-width: 1500px) {
  .peer-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 1000px) {
  .controls {
    grid-template-columns: 1fr 1.2fr;
    gap: 1.25rem;
  }
  .controls > .button {
    justify-self: start;
  }
  .peer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .streams {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  header {
    padding: 1rem;
    gap: 1.25rem;
    min-height: 80px;
  }
  .brand > span {
    min-width: 0;
  }
  .brand img {
    width: 26px;
  }
  .brand {
    font-size: 0.8rem;
  }
  .brand small {
    font-size: 0.55rem;
  }
  nav {
    gap: 1rem;
  }
  .nav {
    font-size: 0.9rem;
  }
  header > .quiet {
    font-size: 0.8rem;
  }
  main {
    padding: 0 1rem;
  }
  .intro {
    padding: 2.5rem 0 1.8rem;
    gap: 1rem;
  }
  .run-state {
    max-width: 145px;
  }
  .run-state p {
    font-size: 0.75rem;
  }
  .controls {
    gap: 1.25rem 1rem;
  }
  .control small {
    font-size: 0.7rem;
  }
  .playback strong {
    font-size: 1rem;
  }
  .collection {
    margin-top: 2rem;
  }
  .collection-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }
  .collection-totals {
    text-align: left;
  }
  .filters {
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .search {
    width: 55%;
  }
  .filters select {
    width: 100%;
    font-size: 0.85rem;
  }
  .filters > label:not(.search) {
    max-width: calc(45% - 0.5rem);
  }
  .filters > .quiet {
    font-size: 0.85rem;
  }
  .peer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 0.65rem;
  }
  .peer-copy {
    padding: 0.65rem;
  }
  .peer-country {
    font-size: 0.85rem;
  }
  .peer-count {
    font-size: 0.65rem;
  }
  .peer-copy h3 {
    font-size: 0.85rem;
  }
  .peer-copy p {
    font-size: 0.7rem;
  }
  .card-actions {
    font-size: 0.75rem;
  }
  .totals {
    font-size: 0.8rem;
  }
  dialog {
    padding: 0 1rem 1rem;
  }
  .detail-heading {
    flex-direction: column;
  }
  .frames {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .frames img {
    height: 145px;
  }
  footer span:last-child {
    display: none;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
