:root {
  --ink: #0d100f;
  --ink-soft: #151918;
  --panel: #1b201e;
  --line: rgba(222, 232, 225, 0.14);
  --line-strong: rgba(222, 232, 225, 0.25);
  --paper: #f0f1ea;
  --paper-muted: #9ba39d;
  --signal: #c8ff3d;
  --signal-dark: #152000;
  --danger: #ff6b4d;
  --body-font: "Avenir Next", "Segoe UI", sans-serif;
  --display-font: "Bahnschrift", "Arial Narrow", sans-serif;
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
  font-family: var(--body-font);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  font-family: var(--display-font);
  font-size: 1.08rem;
  font-stretch: condensed;
  font-weight: 700;
  letter-spacing: .055em;
}

.wordmark > span:last-child > span {
  color: var(--paper-muted);
  font-weight: 380;
}

.wordmark-mark {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.wordmark-mark::before,
.wordmark-mark::after,
.wordmark-mark i::before,
.wordmark-mark i::after {
  position: absolute;
  width: 8px;
  height: 1px;
  background: var(--signal);
  content: "";
}

.wordmark-mark::before { top: 5px; left: 2px; transform: rotate(45deg); }
.wordmark-mark::after { right: 2px; bottom: 5px; transform: rotate(45deg); }
.wordmark-mark i::before { top: 5px; right: 2px; transform: rotate(-45deg); }
.wordmark-mark i::after { left: 2px; bottom: 5px; transform: rotate(-45deg); }

.wordmark-mark i {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(200, 255, 61, .55);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--paper-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.signal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(200, 255, 61, .1);
}

/* Login */
.login-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1.13fr) minmax(420px, .87fr);
}

.login-identity {
  position: relative;
  display: flex;
  overflow: hidden;
  padding: clamp(32px, 5vw, 72px);
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 76% 42%, rgba(200, 255, 61, .11), transparent 22%),
    linear-gradient(132deg, transparent 0 66%, rgba(200, 255, 61, .035) 66% 66.15%, transparent 66.15%),
    var(--ink);
  border-right: 1px solid var(--line);
}

.login-identity::before {
  position: absolute;
  top: 20%;
  right: -15vw;
  width: min(44vw, 620px);
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow:
    0 0 0 9vw rgba(255, 255, 255, .012),
    0 0 0 18vw rgba(255, 255, 255, .008);
  content: "";
  pointer-events: none;
}

.login-identity::after {
  position: absolute;
  right: clamp(32px, 5vw, 72px);
  bottom: clamp(32px, 5vw, 72px);
  width: 84px;
  height: 1px;
  background: var(--signal);
  content: "";
  opacity: .7;
}

.identity-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin-block: 14vh 10vh;
}

.identity-copy h1 {
  max-width: 650px;
  margin: 24px 0 22px;
  font-family: var(--display-font);
  font-size: clamp(3.8rem, 6vw, 7.25rem);
  font-stretch: condensed;
  font-weight: 610;
  letter-spacing: -.05em;
  line-height: .83;
  text-transform: uppercase;
}

.identity-copy > p:last-child {
  max-width: 500px;
  margin: 0;
  color: var(--paper-muted);
  font-size: clamp(.95rem, 1.3vw, 1.1rem);
  line-height: 1.7;
}

.privacy-line {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--paper-muted);
  font-size: .69rem;
  letter-spacing: .08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.privacy-line b {
  color: var(--paper);
}

.privacy-icon {
  position: relative;
  width: 28px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
}

.privacy-icon::before {
  position: absolute;
  top: -9px;
  left: 7px;
  width: 12px;
  height: 13px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  content: "";
}

.privacy-icon::after {
  position: absolute;
  top: 8px;
  left: 12px;
  width: 3px;
  height: 7px;
  background: var(--signal);
  border-radius: 2px;
  content: "";
}

.login-panel {
  display: grid;
  padding: clamp(30px, 7vw, 100px);
  place-items: center;
  background: #e9ebe4;
  color: var(--ink);
}

.login-form-wrap {
  width: min(100%, 440px);
  animation: reveal .65s var(--ease) both;
}

.section-index {
  margin: 0 0 42px;
  color: #6c746e;
  font-family: var(--display-font);
  font-size: .65rem;
  font-weight: 650;
  letter-spacing: .18em;
}

.login-form-wrap h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2.35rem, 4vw, 3.5rem);
  font-stretch: condensed;
  font-weight: 610;
  letter-spacing: -.035em;
  line-height: 1;
  text-transform: uppercase;
}

.form-intro {
  margin: 14px 0 36px;
  color: #606761;
  font-size: .92rem;
  line-height: 1.6;
}

.auth-form {
  display: grid;
}

.auth-form > label {
  margin: 20px 0 8px;
  color: #343a36;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.input-shell {
  position: relative;
}

.input-shell input {
  width: 100%;
  height: 58px;
  padding: 0 52px;
  color: var(--ink);
  background: rgba(255, 255, 255, .44);
  border: 1px solid #bdc2bb;
  border-radius: 3px;
  caret-color: #5a7600;
  font-size: .95rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-shell input:hover {
  border-color: #8d948e;
}

.input-shell input:focus {
  background: rgba(255, 255, 255, .76);
  border-color: #536315;
  box-shadow: 0 0 0 3px rgba(116, 143, 26, .12);
  outline: 0;
}

.input-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 19px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  pointer-events: none;
}

.user-icon {
  border: 1.5px solid #616861;
  border-radius: 50%;
}

.user-icon::after {
  position: absolute;
  right: -4px;
  bottom: -6px;
  left: -4px;
  height: 8px;
  background: #e9ebe4;
  border: 1.5px solid #616861;
  border-radius: 8px 8px 0 0;
  content: "";
}

.key-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid #616861;
  border-radius: 50%;
}

.key-icon::before {
  position: absolute;
  top: 5px;
  left: 12px;
  width: 9px;
  height: 1.5px;
  background: #616861;
  content: "";
}

.key-icon::after {
  position: absolute;
  top: 6px;
  left: 18px;
  width: 4px;
  height: 4px;
  border-left: 1.5px solid #616861;
  content: "";
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 13px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.password-toggle span {
  position: relative;
  display: block;
  width: 18px;
  height: 11px;
  border: 1.4px solid #69706a;
  border-radius: 50% / 65%;
}

.password-toggle span::after {
  position: absolute;
  top: 3px;
  left: 7px;
  width: 3px;
  height: 3px;
  background: #69706a;
  border-radius: 50%;
  content: "";
}

.password-toggle[aria-pressed="true"] span::before {
  position: absolute;
  top: 4px;
  left: -2px;
  width: 21px;
  height: 1.5px;
  background: #69706a;
  content: "";
  transform: rotate(-35deg);
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  margin-top: 34px;
  padding: 0 9px 0 22px;
  align-items: center;
  justify-content: space-between;
  color: #121600;
  background: var(--signal);
  border: 0;
  border-radius: 3px;
  box-shadow: 0 10px 26px rgba(72, 91, 14, .15);
  font-family: var(--display-font);
  font-size: .76rem;
  font-weight: 720;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s ease;
}

.primary-button:hover {
  background: #d6ff70;
  transform: translateY(-2px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.primary-button .arrow {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--paper);
  background: #151a13;
  border-radius: 2px;
  font-size: 1rem;
}

.alert {
  margin: 18px 0 2px;
  padding: 13px 15px;
  border: 1px solid rgba(180, 53, 28, .25);
  border-radius: 3px;
  font-size: .81rem;
  line-height: 1.45;
}

.alert-error {
  color: #7c2819;
  background: rgba(255, 107, 77, .1);
}

.login-footnote {
  margin: 25px 0 0;
  color: #727972;
  font-size: .69rem;
  line-height: 1.5;
  text-align: center;
}

.login-footnote span {
  margin-right: 5px;
  color: #719000;
  font-size: .48rem;
}

/* Viewer */
.app-header {
  display: flex;
  height: 76px;
  padding: 0 clamp(20px, 4vw, 58px);
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 16, 15, .88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-actions,
.user-label {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 18px;
}

.user-label {
  gap: 9px;
  color: var(--paper-muted);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .06em;
}

.user-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--signal);
  background: rgba(200, 255, 61, .08);
  border: 1px solid rgba(200, 255, 61, .28);
  border-radius: 50%;
  font-family: var(--display-font);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.icon-button:hover {
  background: var(--panel);
  border-color: var(--line-strong);
}

.logout-button span {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--paper-muted);
  border-right: 0;
}

.logout-button span::before {
  position: absolute;
  top: 5px;
  left: 6px;
  width: 10px;
  height: 1.5px;
  background: var(--paper-muted);
  content: "";
}

.logout-button span::after {
  position: absolute;
  top: 2px;
  right: -4px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--paper-muted);
  border-right: 1.5px solid var(--paper-muted);
  content: "";
  transform: rotate(45deg);
}

.viewer-layout {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 68px) clamp(18px, 4vw, 58px) 30px;
}

.viewer-title-row {
  display: flex;
  margin-bottom: 27px;
  align-items: flex-end;
  justify-content: space-between;
}

.viewer-title-row h1 {
  margin: 13px 0 0;
  font-family: var(--display-font);
  font-size: clamp(2.55rem, 5vw, 4.7rem);
  font-stretch: condensed;
  font-weight: 580;
  letter-spacing: -.045em;
  line-height: .92;
  text-transform: uppercase;
}

.current-time {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  font-family: var(--display-font);
}

.current-time > span {
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 380;
  letter-spacing: .04em;
}

.current-time small {
  margin-top: 4px;
  color: var(--paper-muted);
  font-size: .57rem;
  font-weight: 620;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.view-switcher {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 4px;
  gap: 3px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.view-tab {
  display: inline-flex;
  min-width: 128px;
  height: 40px;
  padding: 0 15px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #747d77;
  background: transparent;
  border: 0;
  border-radius: 2px;
  font-family: var(--display-font);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, background .2s;
}

.view-tab:hover:not(:disabled) {
  color: var(--paper);
}

.view-tab.is-active {
  color: var(--signal-dark);
  background: var(--signal);
}

.view-tab:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.view-tab small {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  font-size: .5rem;
}

.camera-tab-icon,
.screens-tab-icon {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.camera-tab-icon::before {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 3px;
  height: 3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.camera-tab-icon::after {
  position: absolute;
  top: -4px;
  left: 4px;
  width: 6px;
  height: 3px;
  background: currentColor;
  content: "";
}

.screens-tab-icon::before {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 12px;
  height: 9px;
  background: var(--ink-soft);
  border: 1px solid currentColor;
  border-radius: 1px;
  content: "";
}

.view-tab.is-active .screens-tab-icon::before {
  background: var(--signal);
}

.monitor {
  overflow: hidden;
  background: #050706;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .3);
  animation: reveal .55s .08s var(--ease) both;
}

.monitor:fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
}

.monitor:fullscreen .video-stage {
  min-height: 0;
  height: calc(100vh - 82px);
  height: calc(100dvh - 82px);
}

.monitor:fullscreen.mode-screens {
  overflow-y: auto;
}

.monitor:fullscreen.mode-screens .screens-stage {
  min-height: calc(100vh - 82px);
  min-height: calc(100dvh - 82px);
}

.video-stage {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: min(68vh, 760px);
  place-items: center;
  background:
    radial-gradient(circle at center, #171c19 0, #080a09 65%),
    #080a09;
}

.video-stage > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .45s ease, transform .35s var(--ease);
  user-select: none;
}

.monitor.has-frame .video-stage > img {
  opacity: 1;
}

.monitor.is-mirrored .video-stage > img {
  transform: scaleX(-1);
}

.stage-grid {
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 33.3%, rgba(255, 255, 255, .055) 33.3% 33.45%, transparent 33.45% 66.6%, rgba(255, 255, 255, .055) 66.6% 66.75%, transparent 66.75%),
    linear-gradient(transparent 33.3%, rgba(255, 255, 255, .055) 33.3% 33.45%, transparent 33.45% 66.6%, rgba(255, 255, 255, .055) 66.6% 66.75%, transparent 66.75%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.monitor.has-frame:hover .stage-grid {
  opacity: .42;
}

.stage-vignette {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, .28) 100%);
  pointer-events: none;
}

.stream-badge {
  position: absolute;
  z-index: 5;
  top: 21px;
  left: 22px;
  display: flex;
  padding: 9px 12px;
  align-items: center;
  gap: 9px;
  background: rgba(8, 10, 9, .72);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 2px;
  backdrop-filter: blur(8px);
  font-family: var(--display-font);
  font-size: .61rem;
  font-weight: 720;
  letter-spacing: .13em;
}

.stream-badge .signal-dot {
  width: 6px;
  height: 6px;
  animation: pulse 1.8s ease-in-out infinite;
}

.monitor.state-error .stream-badge .signal-dot,
.monitor.state-stalled .stream-badge .signal-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 107, 77, .1);
  animation: none;
}

.camera-id {
  position: absolute;
  z-index: 5;
  top: 22px;
  right: 22px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
  color: rgba(240, 241, 234, .75);
  text-shadow: 0 1px 5px #000;
}

.camera-id span {
  color: var(--signal);
  font-family: var(--display-font);
  font-size: .55rem;
  font-weight: 700;
  letter-spacing: .15em;
}

.camera-id strong {
  max-width: 280px;
  overflow: hidden;
  font-size: .69rem;
  font-weight: 600;
  letter-spacing: .035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-placeholder {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
  transition: opacity .3s ease;
}

.monitor.has-frame .stream-placeholder {
  opacity: 0;
}

.stream-placeholder strong {
  margin-top: 24px;
  font-family: var(--display-font);
  font-size: .75rem;
  font-weight: 680;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.stream-placeholder p {
  margin: 8px 0 0;
  color: var(--paper-muted);
  font-size: .75rem;
}

.aperture {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  animation: rotate 5s linear infinite;
}

.aperture::before,
.aperture::after,
.aperture span::before {
  position: absolute;
  top: 34px;
  left: 8px;
  width: 54px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.aperture::after {
  transform: rotate(60deg);
}

.aperture span::before {
  transform: rotate(-60deg);
}

.aperture span {
  position: absolute;
  inset: 25px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(200, 255, 61, .3);
}

.focus-corners {
  position: absolute;
  z-index: 4;
  inset: 11%;
  pointer-events: none;
}

.focus-corners i {
  position: absolute;
  width: 25px;
  height: 25px;
  border-color: rgba(255, 255, 255, .28);
  border-style: solid;
}

.focus-corners i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.focus-corners i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.focus-corners i:nth-child(3) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.focus-corners i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }

/* Desktop screens */
.screens-stage {
  display: none;
  min-height: min(68vh, 760px);
  padding: clamp(18px, 2.4vw, 34px);
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    #080a09;
  background-size: 36px 36px;
}

.monitor.mode-screens .camera-view {
  display: none;
}

.monitor.mode-screens .screens-stage {
  display: block;
}

.monitor.mode-all .screens-stage {
  display: block;
  min-height: 0;
  border-top: 1px solid var(--line);
}

.screens-heading {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.screens-heading > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.screens-heading strong {
  font-family: var(--display-font);
  font-size: 1.05rem;
  font-stretch: condensed;
  font-weight: 600;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.screens-heading p {
  margin: 0;
  color: #69716c;
  font-size: .66rem;
}

.screens-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 22px);
}

.screen-card {
  overflow: hidden;
  min-width: 0;
  background: var(--ink-soft);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .22);
}

.screen-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #030504;
}

.screen-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .35s ease;
}

.screen-card.has-frame .screen-frame > img {
  opacity: 1;
}

.screen-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--paper-muted);
  font-family: var(--display-font);
  font-size: .56rem;
  font-weight: 680;
  letter-spacing: .13em;
  text-transform: uppercase;
  transition: opacity .25s;
}

.screen-card.has-frame .screen-loading {
  opacity: 0;
  pointer-events: none;
}

.screen-corners {
  position: absolute;
  inset: 12px;
  pointer-events: none;
}

.screen-corners i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(255, 255, 255, .25);
  border-style: solid;
}

.screen-corners i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.screen-corners i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.screen-corners i:nth-child(3) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.screen-corners i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }

.screen-card > footer {
  display: flex;
  min-height: 64px;
  padding: 11px 12px 11px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.screen-card > footer > div {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 9px;
}

.screen-card footer span:not(.snapshot-icon) {
  color: var(--signal);
  font-family: var(--display-font);
  font-size: .49rem;
  font-weight: 700;
  letter-spacing: .13em;
}

.screen-card footer strong {
  overflow: hidden;
  font-size: .69rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-card footer small {
  grid-column: 2;
  color: #68706b;
  font-family: var(--display-font);
  font-size: .5rem;
  letter-spacing: .08em;
}

.screen-action {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--paper-muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: color .2s, border-color .2s;
}

.screen-action:hover {
  color: var(--signal);
  border-color: rgba(200, 255, 61, .35);
}

.control-deck {
  display: flex;
  min-height: 82px;
  padding: 14px 16px 14px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.stream-metrics,
.viewer-controls {
  display: flex;
  align-items: center;
}

.stream-metrics {
  gap: 22px;
}

.stream-metrics > div:not(.metric-divider) {
  display: flex;
  min-width: 95px;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  color: #69716c;
  font-family: var(--display-font);
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .15em;
}

.stream-metrics strong {
  font-size: .69rem;
  font-weight: 620;
  letter-spacing: .03em;
}

.metric-divider {
  width: 1px;
  height: 30px;
  background: var(--line);
}

.viewer-controls {
  gap: 8px;
}

.control-button {
  display: inline-flex;
  height: 48px;
  padding: 0 15px;
  align-items: center;
  gap: 10px;
  color: var(--paper-muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--display-font);
  font-size: .59rem;
  font-weight: 680;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}

.control-button:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, .035);
  border-color: var(--line-strong);
}

.control-button-accent {
  color: var(--signal-dark);
  background: var(--signal);
  border-color: var(--signal);
}

.control-button-accent:hover {
  color: var(--signal-dark);
  background: #d6ff70;
  border-color: #d6ff70;
}

.mirror-icon,
.snapshot-icon,
.fullscreen-icon {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
}

.mirror-icon {
  border-right: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

.mirror-icon::before,
.mirror-icon::after {
  position: absolute;
  top: 4px;
  width: 5px;
  height: 5px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  content: "";
}

.mirror-icon::before { left: 2px; transform: rotate(-45deg); }
.mirror-icon::after { right: 2px; transform: rotate(135deg); }

.snapshot-icon {
  border: 1px solid currentColor;
  border-radius: 2px;
}

.snapshot-icon::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.snapshot-icon::after {
  position: absolute;
  top: -3px;
  left: 4px;
  width: 6px;
  height: 3px;
  background: currentColor;
  content: "";
}

.fullscreen-icon {
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 0 0 / 1px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 1px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 1px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 6px 1px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 100% / 1px 6px no-repeat;
}

.viewer-footer {
  display: flex;
  padding: 17px 3px 0;
  justify-content: space-between;
  gap: 20px;
  color: #69716c;
  font-family: var(--display-font);
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.viewer-footer p {
  margin: 0;
}

.lock-mini {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 7px;
  margin-right: 6px;
  border: 1px solid #69716c;
}

.lock-mini::before {
  position: absolute;
  top: -5px;
  left: 1px;
  width: 5px;
  height: 5px;
  border: 1px solid #69716c;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  content: "";
}

.public-address {
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 17px;
  color: var(--ink);
  background: var(--paper);
  border-left: 3px solid var(--signal);
  border-radius: 2px;
  box-shadow: 0 14px 45px rgba(0, 0, 0, .4);
  font-size: .75rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .22s, transform .22s;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Error */
.error-page {
  display: grid;
  padding: 24px;
  place-items: center;
}

.error-card {
  width: min(100%, 520px);
  padding: clamp(30px, 7vw, 65px);
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.error-code {
  margin: 70px 0 6px;
  color: var(--signal);
  font-family: var(--display-font);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
}

.error-card h1 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(2.3rem, 8vw, 4rem);
  font-stretch: condensed;
  font-weight: 580;
  letter-spacing: -.04em;
  line-height: .95;
  text-transform: uppercase;
}

.error-card > p:not(.error-code) {
  margin: 20px 0 0;
  color: var(--paper-muted);
  line-height: 1.6;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 4px rgba(200, 255, 61, .1); }
  50% { opacity: .55; box-shadow: 0 0 0 7px rgba(200, 255, 61, 0); }
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-identity {
    min-height: 41vh;
    padding: 28px clamp(24px, 7vw, 50px);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .identity-copy {
    margin: 9vh 0 2vh;
  }

  .identity-copy h1 {
    margin-block: 18px 14px;
    font-size: clamp(3rem, 13vw, 5.2rem);
  }

  .identity-copy > p:last-child,
  .privacy-line {
    display: none;
  }

  .login-panel {
    padding: 46px clamp(24px, 8vw, 60px) max(46px, env(safe-area-inset-bottom));
    place-items: start center;
  }

  .section-index {
    margin-bottom: 24px;
  }

  .video-stage {
    min-height: min(62vh, 650px);
  }

  .screens-grid {
    grid-template-columns: 1fr;
  }

  .control-deck {
    align-items: stretch;
    flex-direction: column;
  }

  .stream-metrics {
    padding: 6px 4px 10px;
  }

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

  .control-button {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .app-header {
    height: 54px;
    padding-inline: 14px;
  }

  .user-name {
    display: none;
  }

  .header-actions {
    gap: 9px;
  }

  .viewer-layout {
    padding: 14px 10px 18px;
  }

  .viewer-title-row {
    margin-bottom: 10px;
    align-items: center;
  }

  .view-switcher {
    display: grid;
    width: 100%;
    margin-bottom: 8px;
    grid-template-columns: repeat(3, 1fr);
  }

  .view-tab {
    min-width: 0;
    height: 34px;
    padding-inline: 6px;
    gap: 5px;
    font-size: .5rem;
  }

  .viewer-title-row h1 {
    margin-top: 4px;
    font-size: clamp(1.35rem, 6.5vw, 1.8rem);
    line-height: 1;
  }

  .eyebrow {
    font-size: .48rem;
  }

  .current-time > span {
    font-size: clamp(.95rem, 4.8vw, 1.25rem);
  }

  .current-time small {
    display: none;
  }

  .monitor {
    border-radius: 3px;
  }

  .video-stage {
    width: 100%;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .video-stage > img {
    object-fit: contain;
  }

  .screens-stage {
    min-height: 0;
    padding: 12px;
  }

  .screens-heading {
    margin: 2px 2px 12px;
  }

  .screens-heading p {
    display: none;
  }

  .screens-heading strong {
    font-size: .88rem;
  }

  .screens-grid {
    gap: 10px;
  }

  .screen-card > footer {
    min-height: 58px;
  }

  .stream-badge {
    top: 13px;
    left: 13px;
  }

  .camera-id {
    top: 14px;
    right: 13px;
  }

  .camera-id strong {
    max-width: 145px;
  }

  .focus-corners {
    inset: 13%;
  }

  .control-deck {
    padding: 13px;
    gap: 8px;
  }

  .stream-metrics {
    justify-content: space-between;
  }

  .stream-metrics > div:not(.metric-divider) {
    min-width: auto;
  }

  .viewer-controls {
    gap: 6px;
  }

  .control-button {
    height: 52px;
    padding: 0 7px;
    flex-direction: column;
    gap: 5px;
    font-size: .5rem;
  }

  .viewer-footer {
    justify-content: center;
    text-align: center;
  }

  .viewer-footer p:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
