:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #222926;
  background: #f4f5f0;
  --ink: #18231f;
  --sub: #55615b;
  --line: #d6dbd3;
  --paper: #fff;
  --green: #bcec82;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid #cbd2c9;
  border-radius: 6px;
  padding: 8px 13px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.865rem;
  font-weight: 620;
}
button:hover:not(:disabled) {
  background: #edf1e9;
  border-color: #93a08f;
}
button:disabled,
select:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}
button.primary,
.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}
button.primary:hover:not(:disabled) {
  background: #2d4438;
  border-color: #2d4438;
}
button.primary > span {
  color: var(--green);
}
button.danger {
  background: #923d2d;
  border-color: #923d2d;
  color: white;
}
button.danger:hover:not(:disabled) {
  background: #783121;
}
.danger-text {
  color: #8b3828;
}
:is(button, a, input, textarea, select, canvas, summary):focus-visible {
  outline: 3px solid #4d8d43;
  outline-offset: 3px;
}
input,
textarea,
select {
  border: 1px solid #c8cfc5;
  color: var(--ink);
  background: white;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
  max-width: 100%;
  font-size: 0.91rem;
}
input::placeholder {
  color: #6d776f;
}
label {
  display: block;
  font-size: 0.865rem;
  font-weight: 650;
}
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}
h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.045em;
  line-height: 1.1;
}
h1 {
  font-size: clamp(2.15rem, 3.4vw, 3.55rem);
  font-weight: 620;
}
h2 {
  font-size: clamp(1.2rem, 1.75vw, 1.55rem);
  font-weight: 650;
}
h3 {
  font-size: 1rem;
  letter-spacing: -0.015em;
}
.muted,
.form-note,
.no-ops {
  color: var(--sub);
  font-size: 0.88rem;
  line-height: 1.5;
}
.skip {
  position: fixed;
  z-index: 10;
  left: 12px;
  top: -60px;
  color: var(--ink);
  background: var(--green);
  padding: 10px;
}
.skip:focus {
  top: 7px;
}
.mast {
  background: #17221f;
  color: white;
}
.mast-inner {
  max-width: 1640px;
  min-height: 64px;
  margin: auto;
  padding: 0 clamp(16px, 3.6vw, 60px);
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 78px);
}
.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  letter-spacing: -0.055em;
  font-weight: 680;
  white-space: nowrap;
}
.mark {
  position: relative;
  display: block;
  width: 27px;
  height: 28px;
}
.mark::before,
.mark::after {
  position: absolute;
  content: "";
  display: block;
  border: 2px solid var(--green);
  border-radius: 4px;
  width: 14px;
  height: 21px;
}
.mark::before {
  left: 1px;
  top: 1px;
}
.mark::after {
  right: 3px;
  bottom: 1px;
  background: #17221f;
}
.mast nav,
.session,
.tools,
.pagination,
.pagination > div,
.panel-heading,
.dialog-head,
.mode-row,
.dialog-actions {
  display: flex;
  align-items: center;
}
.mast nav {
  gap: 25px;
}
.mast nav a {
  color: #d3dfd7;
  text-decoration: none;
  font-size: 0.86rem;
}
.mast nav a:hover {
  color: white;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.session {
  margin-left: auto;
  gap: 14px;
}
.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: #e3eadf;
  white-space: nowrap;
}
.connection::before,
.card-status::before,
.pill.is-live::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 100%;
  background: #96a49b;
}
.connection[data-kind="ok"]::before {
  background: var(--green);
}
.connection[data-kind="wait"]::before {
  background: #eab663;
}
.mast-btn {
  min-height: 30px;
  padding: 4px 9px;
  background: transparent;
  border-color: #536159;
  color: #f8fbf5;
}
.mast-btn:hover:not(:disabled) {
  background: #304239;
}
main {
  max-width: 1640px;
  margin: auto;
  padding: clamp(21px, 3.5vw, 49px) clamp(16px, 3.6vw, 60px) 60px;
}
.heading-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 22px;
}
.heading-bar p {
  margin-top: 8px;
}
.tools {
  flex-wrap: wrap;
  gap: 7px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 25px 0 18px;
  background: #e9ede5;
  border-block: 1px solid #d5dcd0;
}
.stats > div {
  padding: 12px 18px;
}
.stats > div + div {
  border-left: 1px solid #d2dacd;
}
.stats dt,
.details dt {
  color: var(--sub);
  font-size: 0.78rem;
  font-weight: 550;
}
.stats dd {
  margin-top: 2px;
  font: 600 clamp(1.05rem, 1.6vw, 1.5rem)/1.3 var(--mono);
  letter-spacing: -0.04em;
}
.action-status {
  margin: 0 0 14px;
  padding: 9px 13px;
  border-left: 3px solid #5b784f;
  background: #e7eee2;
  font-size: 0.85rem;
}
.action-status[data-level="error"],
.form-message,
.dialog-status[data-level="error"] {
  color: #843324;
}
.action-status[data-level="error"] {
  background: #f7e7df;
  border-color: #aa4e37;
}
.workbench {
  display: grid;
  grid-template-columns: minmax(290px, 0.88fr) minmax(420px, 1.6fr);
  gap: 16px;
  align-items: start;
}
.panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.panel-heading,
.dialog-head {
  min-height: 65px;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  color: var(--sub);
  font-weight: 650;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.pill,
.card-role,
.count {
  align-items: center;
  display: inline-flex;
  white-space: nowrap;
  border-radius: 4px;
  font: 550 0.71rem/1.3 var(--mono);
}
.pill {
  gap: 6px;
  background: #edf0e9;
  color: #48554c;
  padding: 5px 8px;
}
.pill.is-live {
  color: #2e5c35;
  background: #e7f3df;
}
.pill.is-live::before {
  background: #4b8b4f;
}
.count {
  background: #edf0e9;
  padding: 5px 8px;
  color: var(--sub);
}
.monitor,
.thumbnail,
.auth-art {
  background-color: #1c2824;
  background-image: radial-gradient(#3a4941 0.8px, transparent 0.9px);
  background-size: 13px 13px;
}
.monitor {
  width: min(100%, clamp(180px, 32svh, 325px));
  aspect-ratio: 9 / 16;
  height: auto;
  margin: 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.monitor canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  object-fit: contain;
  background: transparent;
  touch-action: none;
}
.monitor canvas:focus-visible {
  outline-offset: -3px;
}
.screen-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.screen-options button { min-height: 32px; padding: 3px 8px; }
.monitor:fullscreen, .monitor.expanded {
  width: 100%; height: 100%; max-width: none; margin: 0; aspect-ratio: auto;
}
.monitor.expanded { position: fixed; inset: 0; z-index: 10; }
.monitor .leave-expanded { position: absolute; right: 12px; top: 12px; z-index: 1; }
.monitor:not(:fullscreen):not(.expanded) .leave-expanded { display: none; }
.screen-empty {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 13px;
  color: #b6c5b9;
  font-size: 0.83rem;
}
.phone-outline {
  display: block;
  width: 20px;
  height: 32px;
  border: 1.5px solid #83988a;
  border-radius: 5px;
  position: relative;
}
.phone-outline::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1px;
  background: #83988a;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}
.android-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.android-keys button {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  padding: 7px 2px;
  font-size: 0.78rem;
}
.android-keys button + button {
  border-left: 1px solid var(--line);
}
.android-keys button span {
  font-family: var(--mono);
  font-size: 1rem;
}
.mode-row {
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
}
.mode-row label {
  font-size: 0.8rem;
}
.mode-row select {
  min-height: 33px;
  padding: 3px 6px;
  font-size: 0.78rem;
}
.solo-exit {
  margin: 0 16px 14px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  gap: 8px;
  padding: 0 16px 14px;
}
.filters select {
  font-size: 0.8rem;
}
.grid {
  --full-thumb: calc((100% - 30px) / 4);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 0 16px 15px;
}
.device-card {
  flex: 0 0 auto;
  width: calc(var(--full-thumb) * 0.6);
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  min-width: 0;
  border: 1px solid #ced5cb;
  border-radius: 7px;
  background: #fff;
}
.device-card .card-info {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 6px;
}
.device-card :is(.card-role, .card-status) {
  justify-self: start;
  max-width: 100%;
}
.device-card .card-name {
  font-size: .77rem;
}
.device-card:hover:not(:disabled) {
  background: #f6f8f2;
  border-color: #71936a;
}
.device-card[data-active="true"] {
  border-color: #54794b;
  box-shadow: 0 0 0 1px #54794b;
}
.thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  flex: 0 0 auto;
  background-color: #24312b;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumbnail img,
.thumbnail canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.thumb-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #c9d3cb;
  font-size: 0.69rem;
  font-weight: 500;
}
.thumb-empty .phone-outline {
  width: 15px;
  height: 23px;
}
.card-info {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 3px;
  align-items: center;
}
.card-name {
  font: 650 0.87rem/1.3 var(--mono);
  overflow-wrap: anywhere;
}
.card-role {
  font-size: 0.6rem;
  color: #526051;
  background: #edf1e9;
  padding: 2px 4px;
}
.device-card[data-active="true"] .card-role {
  color: #355b29;
  background: #e1edcf;
}
.card-status {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.73rem;
  font-weight: 500;
  color: #4f5c53;
}
.card-status::before {
  width: 6px;
  height: 6px;
}
.device-card[data-status="synced"] .card-status::before {
  background: #3c834e;
}
.device-card[data-status="drifted"] .card-status::before {
  background: #bd5631;
}
.device-card[data-status="paused"] .card-status::before {
  background: #b2883c;
}
.pagination {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  padding: 9px 16px;
  color: var(--sub);
  font: 0.75rem var(--mono);
}
.pagination > div {
  gap: 5px;
}
.pagination button {
  width: 34px;
  min-height: 30px;
  padding: 1px 5px;
  font-size: 1.2rem;
}
.no-devices,
.no-ops {
  padding: 8px 18px 22px;
}
.operations {
  margin-top: 17px;
}
.operations .panel-heading {
  min-height: 52px;
}
.operations h2 {
  font-size: 1.08rem;
}
#log {
  list-style: none;
  padding: 0;
}
#log li {
  border-top: 1px solid var(--line);
  padding: 10px 17px;
}
#log summary {
  cursor: pointer;
  font-size: 0.84rem;
}
#log summary span {
  margin-left: 7px;
}
#log time {
  font: 0.72rem var(--mono);
  color: var(--sub);
}
#log pre {
  max-height: 215px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #eff2eb;
  padding: 10px;
  font: 0.77rem/1.5 var(--mono);
  color: #34453a;
}
#log [data-level="error"] strong {
  color: #923d2d;
}
dialog {
  border: 1px solid #c9d2c7;
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  width: min(430px, calc(100% - 28px));
  max-height: calc(100svh - 32px);
  box-shadow: 0 20px 70px #111d2540;
}
dialog::backdrop {
  background: #17221fb0;
}
.dialog-head {
  border-bottom: 1px solid var(--line);
}
.close {
  width: 33px;
  min-height: 32px;
  padding: 0;
  border-color: transparent;
  font: 1.55rem/1 system-ui;
}
.dialog-body {
  padding: 18px;
  display: grid;
  gap: 13px;
}
.dialog-body > form {
  display: grid;
  gap: 10px;
}
.dialog-body > form + form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.dialog-body h3 {
  margin-top: 2px;
}
.dialog-body textarea {
  resize: vertical;
  min-height: 75px;
}
.dialog-body button {
  justify-self: start;
}
.dialog-status:empty,
.form-message:empty {
  display: none;
}
.dialog-status,
.form-message,
.detail-reason {
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.detail-health {
  font-weight: 650;
}
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #f1f3ed;
  padding: 12px;
  border-radius: 6px;
}
.details dd {
  font: 0.79rem var(--mono);
  margin-top: 3px;
}
.detail-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dialog-actions {
  justify-content: flex-end;
}
.dialog-actions button {
  min-height: 38px;
}
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1030px;
  min-height: 490px;
  margin: clamp(14px, 6vh, 70px) auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.auth-content {
  padding: clamp(26px, 5vw, 66px);
  align-self: center;
}
.section-rule {
  height: 4px;
  width: 34px;
  background: #90bd66;
  margin-bottom: 19px;
}
.auth-content h1 {
  font-size: clamp(2.45rem, 4.4vw, 4.65rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}
.auth-content > p {
  color: var(--sub);
  line-height: 1.5;
  margin: 17px 0 23px;
  max-width: 34ch;
}
.auth-content form {
  display: grid;
  gap: 8px;
}
.auth-content input {
  min-height: 44px;
}
.auth-content button {
  justify-content: space-between;
  margin-top: 4px;
  min-height: 44px;
  padding-inline: 14px;
}
.auth-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  background-size: 16px 16px;
}
.phone-stack {
  position: relative;
  width: 185px;
  height: 245px;
  transform: rotate(-12deg);
}
.phone-stack i {
  position: absolute;
  inset: 7px 36px;
  border: 2px solid #5d7568;
  border-radius: 17px;
  background: #25352d;
}
.phone-stack i::before {
  content: "";
  position: absolute;
  width: 27%;
  height: 4px;
  background: currentColor;
  top: 9px;
  left: 36%;
  border-radius: 3px;
}
.phone-stack i:nth-child(1) {
  transform: translate(-40px, -17px);
  color: #658170;
}
.phone-stack i:nth-child(2) {
  transform: translate(-15px, 0);
  color: #7c9b84;
}
.phone-stack i:nth-child(3) {
  transform: translate(13px, 17px);
  color: #bcec82;
  border-color: #bcec82;
  background: repeating-linear-gradient(150deg, #273b2f 0, #273b2f 18px, #304636 19px, #273b2f 20px);
}
@media (max-width: 1050px) {
  .workbench {
    grid-template-columns: minmax(255px, 0.8fr) minmax(355px, 1.15fr);
  }
  .heading-bar {
    align-items: flex-start;
  }
  .heading-bar .tools {
    justify-content: flex-end;
  }
  .grid {
    --full-thumb: calc((100% - 10px) / 2);
  }
}
@media (max-width: 760px) {
  .mast-inner {
    min-height: 54px;
    gap: 14px;
  }
  .mast nav {
    display: none;
  }
  .heading-bar {
    display: block;
  }
  .heading-bar .tools {
    justify-content: flex-start;
    margin-top: 15px;
  }
  .workbench {
    grid-template-columns: 1fr;
  }
  .stats {
    margin: 17px 0 12px;
  }
  .stats > div {
    padding: 9px;
  }
  .stats dt {
    font-size: 0.67rem;
  }
  .monitor {
    width: min(100%, clamp(175px, 34svh, 275px));
  }
  .grid {
    --full-thumb: calc((100% - 20px) / 3);
  }
  .auth {
    grid-template-columns: 1fr minmax(130px, 0.55fr);
    min-height: 415px;
  }
  .phone-stack {
    transform: scale(0.72) rotate(-12deg);
  }
}
@media (max-width: 480px) {
  .auth {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .auth-art {
    display: none;
  }
  .auth-content {
    padding: 30px 22px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats > div:nth-child(3) {
    border-left: 0;
  }
  .stats > div:nth-child(n + 3) {
    border-top: 1px solid #d2dacd;
  }
  .tools button {
    font-size: 0.79rem;
    padding: 7px 9px;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .grid {
    --full-thumb: calc((100% - 7px) / 2);
    gap: 7px;
    padding-inline: 12px;
  }
  .card-info {
    grid-template-columns: 1fr;
  }
  .card-role {
    justify-self: start;
  }
  .session {
    gap: 6px;
  }
  .connection {
    font-size: 0.65rem;
  }
  .android-keys button {
    font-size: 0.7rem;
  }
  .panel-heading {
    padding: 13px 14px;
  }
  .device-card .card-name {
    font-size: 0.79rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}
