:root {
  --paper: #f6f7f1;
  --card: #fff;
  --ink: #223b34;
  --muted: #73837a;
  --green: #126c5d;
  --pale: #e5f0e9;
  --line: #e2e8e0;
  --orange: #a7642b;
  --radius: 22px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: white;
  padding: 13px 20px;
  min-height: 46px;
  font-weight: 600;
}
button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.secondary {
  background: var(--pale);
  color: var(--green);
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
button.danger {
  background: #faece7;
  color: #ac4032;
}
input,
select,
textarea {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  outline: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #126c5d12;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
  flex-shrink: 0;
}
input[type="time"] {
  min-width: 0;
}
label {
  display: block;
  font-size: 14px;
  margin: 16px 0 8px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1.25;
}
h2 {
  font-size: 21px;
  line-height: 1.4;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.75;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
  line-height: 1.6;
}
.shell {
  max-width: 1120px;
  margin: auto;
  padding: 30px 28px 110px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 38px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
  font-weight: 750;
}
.mark {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  gap: 4px;
  padding: 13px;
  border-radius: 15px;
  background: var(--green);
}
.mark i {
  display: block;
  width: 9px;
  height: 19px;
  border: 3px solid #fff;
  border-radius: 2px;
}
.mark i:last-child {
  height: 23px;
  margin-top: -2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 30px;
  padding: 6px 11px;
  background: var(--pale);
  color: var(--green);
  font-size: 12px;
}
.badge.off {
  background: #f0ede6;
  color: #817764;
}
.dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 12px;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 0 25px;
}
.heading p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 25px;
}
.card.feature {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.feature p,
.feature small {
  color: #c5dcd0;
}
.feature .badge {
  background: #ffffff1c;
  color: white;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.actions button {
  flex: 1;
  white-space: nowrap;
}
.number {
  font-size: 50px;
  font-weight: 650;
  letter-spacing: -2px;
  line-height: 1.2;
  margin: 16px 0 6px;
}
.number span {
  font-size: 17px;
  margin-left: 5px;
  letter-spacing: 0;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
}
.stat-grid div {
  border-left: 1px solid #ffffff30;
  padding-left: 14px;
}
.stat-grid strong {
  display: block;
  font-size: 19px;
  margin-bottom: 5px;
}
.icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--pale);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 21px;
  flex-shrink: 0;
}
.section-title {
  margin: 30px 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child {
  border-bottom: 0;
}
.list-item .grow {
  flex: 1;
  min-width: 0;
}
.list-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.list-item p {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.nav {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: #ffffffed;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px #14392a0e;
  backdrop-filter: blur(12px);
  border-radius: 22px;
  padding: 8px;
  z-index: 5;
}
.nav button {
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  min-width: 85px;
  padding: 12px 15px;
}
.nav button.active {
  background: var(--green);
  color: #fff;
}
.nav b {
  display: block;
  font-size: 18px;
  margin-bottom: 4px;
}
.empty {
  text-align: center;
  padding: 48px 20px;
}
.empty .icon {
  margin: 0 auto 20px;
  width: 60px;
  height: 60px;
  font-size: 28px;
}
.empty h2 {
  margin-bottom: 12px;
}
.empty p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 auto;
  max-width: 360px;
}
.hint {
  border-radius: 13px;
  padding: 13px 16px;
  background: #f8f5e9;
  color: #837248;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 16px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.check label {
  margin: 0;
  flex: 1;
  line-height: 1.6;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.full {
  grid-column: 1/-1;
}
.code {
  text-align: center;
  font-size: 42px;
  letter-spacing: 8px;
  font-weight: 650;
  margin: 25px 0;
  color: var(--green);
}
.login {
  max-width: 460px;
  margin: 8vh auto;
  padding: 30px;
}
.login .brand {
  margin-bottom: 55px;
}
.login h1 {
  font-size: 38px;
}
.login p {
  margin: 15px 0 25px;
  color: var(--muted);
}
.login form {
  margin-top: 30px;
}
.login button {
  width: 100%;
  margin-top: 14px;
}
.status-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 15px;
}
.app-list {
  max-height: 300px;
  overflow: auto;
  margin-top: 12px;
}
.app-list .check {
  padding: 9px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.app-list small {
  display: block;
}
dialog {
  max-width: 640px;
  width: calc(100% - 32px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  color: var(--ink);
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: #17362b70;
  backdrop-filter: blur(4px);
}
dialog h2 {
  padding-right: 40px;
}
.close {
  position: absolute;
  right: 15px;
  top: 15px;
  background: var(--paper);
  color: var(--muted);
  min-height: 34px;
  padding: 6px 11px;
}
.screen-frame {
  background: #15221e;
  border-radius: 14px;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  margin-top: 18px;
  min-height: 180px;
}
.media-state {
  padding: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.pill {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-size: 12px;
}
.days {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.days .check {
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 12px 20px;
  background: #223b34;
  color: white;
  border-radius: 13px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 20;
}
#toast.show {
  opacity: 1;
}
.coordinate {
  font-family: ui-monospace, monospace;
  font-size: 18px;
  line-height: 1.8;
  margin: 20px 0 10px;
}
.progress {
  background: #ffffff25;
  height: 6px;
  border-radius: 8px;
  overflow: hidden;
  margin: 14px 0;
}
.progress i {
  display: block;
  height: 100%;
  background: #efcf88;
  border-radius: 8px;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
}
.version {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 35px;
}
.warn {
  color: var(--orange);
}
@media (min-width: 760px) {
  .nav {
    bottom: 24px;
  }
  .nav button {
    min-width: 120px;
  }
  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
  }
  .login {
    margin-top: 6vh;
  }
  .login-card {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: white;
    padding: 36px;
  }
}
@media (max-width: 600px) {
  .shell {
    padding: 22px 18px 120px;
  }
  .topbar {
    margin-bottom: 24px;
  }
  .brand {
    font-size: 19px;
  }
  .mark {
    padding: 11px;
  }
  .heading h1 {
    font-size: 29px;
  }
  .heading {
    align-items: flex-start;
  }
  .heading select {
    max-width: 160px;
    padding: 10px;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .card {
    padding: 22px;
    border-radius: 20px;
  }
  .nav {
    bottom: 10px;
    width: calc(100% - 28px);
    justify-content: space-between;
    gap: 0;
  }
  .nav button {
    min-width: 0;
    flex: 1;
    padding: 10px 8px;
    font-size: 11px;
  }
  .number {
    font-size: 46px;
  }
  .login {
    padding: 25px;
    margin: 3vh auto;
  }
  .login .brand {
    margin-bottom: 42px;
  }
  .stat-grid strong {
    font-size: 17px;
  }
  .full {
    grid-column: auto;
  }
  dialog {
    padding: 23px;
  }
  .actions button {
    padding: 12px;
    font-size: 13px;
  }
}
.device-context {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.device-context select {
  max-width: 260px;
}
.device-title {
  overflow-wrap: anywhere;
}
.device-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0 18px;
  margin-bottom: 22px;
}
.device-tabs button {
  background: transparent;
  color: var(--muted);
}
.device-tabs button.active {
  background: var(--pale);
  color: var(--green);
}
.device-facts {
  display: flex;
  gap: 20px;
  margin: 16px 0;
  font-size: 14px;
}
.device-card h2 {
  overflow-wrap: anywhere;
}
.permission-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.permission-state {
  font-size: 12px;
  white-space: nowrap;
}
.permission-state.enabled {
  color: var(--green);
}
.permission-state.disabled {
  color: var(--muted);
}
.permission-check {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pale);
  width: 19px;
  height: 19px;
  font-weight: 800;
}
.share-request {
  border: 2px solid var(--green);
  margin-bottom: 20px;
  background: var(--pale);
}
[hidden] {
  display: none !important;
}
/* Setup guidance and readable eight-digit pairing codes, including narrow phones. */
.shell.detail-shell {
  padding-bottom: 32px;
}
.permission-help {
  background: transparent;
  color: var(--green);
  font-size: 12px;
  padding: 4px 0;
  min-height: 28px;
}
.brand-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 22px;
}
.brand-option {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 500;
}
.brand-option.selected {
  background: var(--pale);
  border-color: var(--green);
  color: var(--green);
}
.guide-steps ol {
  padding-left: 24px;
  line-height: 1.8;
  font-size: 14px;
}
.guide-steps li + li {
  margin-top: 12px;
}
.guide-restricted {
  margin: 18px 0;
  background: var(--paper);
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
}
.guide-restricted summary {
  cursor: pointer;
  font-weight: 600;
}
.pair-code-input,
.pair-code-display {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin: 24px 0 16px;
  width: 100%;
}
.pair-code-input .code-digit,
.pair-code-display span {
  min-width: 0;
  width: 100%;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
.pair-code-display span {
  display: grid;
  place-items: center;
  color: var(--green);
  border-color: #c5dace;
}
@media (max-width: 380px) {
  .pair-code-input,
  .pair-code-display {
    gap: 4px;
  }
  .pair-code-input .code-digit,
  .pair-code-display span {
    height: 44px;
    font-size: 20px;
  }
  .brand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.viewer-toolbar button {
  padding: 9px 12px;
  min-height: 42px;
}
.viewer-toolbar output {
  font-size: 13px;
  min-width: 40px;
  text-align: center;
}
.media-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50vh;
  min-height: 180px;
  background: #15251f;
  overflow: hidden;
  border-radius: 14px;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.media-stage:active {
  cursor: grabbing;
}
.media-stage img {
  display: block;
  flex: none;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center;
  will-change: transform;
}
.media-stage img[hidden] {
  display: none;
}
dialog.media-fullscreen,
dialog:fullscreen {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}
dialog.media-fullscreen .media-stage,
dialog:fullscreen .media-stage {
  flex: 1;
  min-height: 140px;
  height: 0;
  max-height: none;
}
dialog.media-fullscreen #media-help,
dialog.media-fullscreen .summary,
dialog:fullscreen #media-help,
dialog:fullscreen .summary {
  display: none;
}
dialog.media-fullscreen h2,
dialog:fullscreen h2 {
  font-size: 18px;
  margin: 0 0 8px;
}
dialog.media-fullscreen .actions,
dialog:fullscreen .actions {
  margin-top: 6px;
}
.heading > div {
  min-width: 0;
}
.heading > [data-action="pair-request"] {
  white-space: nowrap;
  flex-shrink: 0;
  padding-inline: 16px;
}
.device-context > button,
[data-action="device-note"] {
  white-space: nowrap;
  flex-shrink: 0;
}
.device-switch-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.device-switch-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.device-switch-option.selected {
  background: var(--pale);
  border-color: var(--green);
}
.device-switch-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.device-switch-option small {
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--muted);
}
