:root {
  color-scheme: dark;
  --bg: #14181d;
  --surface: #1d2126;
  --text: #f5f6f7;
  --muted: #aeb6c0;
  --line: #353c45;
  --active: #57dfa5;
  --focus: #8ec9ff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100svh;
  padding: 32px 16px;
  padding-top: max(32px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
button,
input {
  font: inherit;
}
button,
a,
input {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--focus);
}
::selection {
  color: #10171b;
  background: var(--active);
}
input {
  caret-color: var(--active);
}
a {
  color: var(--focus);
  text-underline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: #2a3037;
  min-height: 44px;
  padding: 9px 13px;
}
button:hover {
  background: #343c45;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
.panel {
  max-width: 540px;
  margin: auto;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px #0003;
}
header {
  padding: 26px 24px 20px;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand img {
  display: block;
  width: 44px;
  height: 44px;
  flex: none;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
  font-weight: 650;
}
.status {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--muted);
  border-radius: 50%;
  flex: none;
}
.status.online {
  color: var(--active);
}
.status.online::before {
  background: var(--active);
}
.quiet {
  border: 0;
  background: transparent;
  color: var(--muted);
}
.quiet:hover {
  background: #ffffff0a;
  color: var(--text);
}
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 24px 20px;
  background: #ffffff09;
  border-radius: 9px;
  padding: 0 12px;
}
.search svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.7;
  flex: none;
}
input {
  border: 1px solid var(--line);
  background: #14181d;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  min-height: 44px;
  min-width: 0;
}
input::placeholder {
  color: var(--muted);
}
.search input {
  border: 0;
  background: transparent;
  width: 100%;
  padding-left: 0;
}
.project {
  border-top: 1px solid var(--line);
  padding: 22px 24px;
}
.project-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-icon {
  height: 42px;
  width: 42px;
  display: grid;
  place-items: center;
  background: #ffffff08;
  border-radius: 10px;
  flex: none;
  color: var(--muted);
}
.project.active .project-icon {
  color: var(--active);
}
.project-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.7;
  fill: none;
}
.identity {
  min-width: 0;
  flex: 1;
}
.identity h2 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}
.identity p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.switch {
  width: 48px;
  height: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 30px;
  padding: 3px;
  background: #59616a;
  flex: none;
}
.switch::after {
  content: '';
  display: block;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transform: translateX(0);
  transition: transform 0.18s ease-out;
}
.switch[aria-checked='true'] {
  background: var(--active);
}
.switch[aria-checked='true']::after {
  transform: translateX(20px);
}
.switch:disabled {
  cursor: default;
}
.address {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
}
.address span {
  font-size: 13px;
  overflow-wrap: anywhere;
  min-width: 0;
  flex: 1;
  color: var(--muted);
}
.project.active .address span {
  color: var(--text);
}
.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 8px;
  display: grid;
  place-items: center;
}
.icon-button svg {
  height: 17px;
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.access {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.project.active .access {
  color: var(--active);
}
details {
  margin-top: 14px;
}
summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
}
summary::before {
  content: '›';
  font-size: 18px;
  transition: transform 0.15s ease-out;
}
details[open] summary::before {
  transform: rotate(90deg);
}
.details-body {
  padding-top: 8px;
}
.details-body label {
  display: block;
  font-size: 12px;
  margin: 12px 0 8px;
}
.segments {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.segments button {
  flex: 1;
  border: 0;
  background: transparent;
  min-height: 38px;
  font-size: 13px;
}
.segments button.selected {
  background: #46515c;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 12px 0;
}
.rename {
  display: flex;
  gap: 8px;
}
.rename input {
  width: 100%;
  flex: 1;
}
.rename button {
  font-size: 12px;
}
.empty {
  padding: 30px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.6;
}
.empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}
footer {
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
}
footer p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin: 0;
}
footer button {
  font-size: 12px;
  white-space: nowrap;
}
#error {
  margin: 0 24px 16px;
  color: #ffbb89;
  font-size: 13px;
  line-height: 1.5;
}
form {
  margin: 0;
}
.login {
  margin-top: 9vh;
}
.login header p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 0;
}
.login form {
  padding: 8px 24px 16px;
  display: grid;
  gap: 12px;
}
.login label {
  font-size: 13px;
}
.primary {
  background: var(--active);
  color: #10221a;
  border: 0;
  font-weight: 600;
}
.primary:hover {
  background: #7bedbc;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  padding: 8px 24px 26px;
}
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background: #505b68;
  border-radius: 8px;
}
@media (max-width: 540px) {
  body {
    padding: 0;
    background: var(--surface);
  }
  .panel {
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  header,
  .project {
    padding-left: 20px;
    padding-right: 20px;
  }
  .search {
    margin-left: 20px;
    margin-right: 20px;
  }
  .login {
    margin-top: 0;
    padding-top: max(12vh, env(safe-area-inset-top));
  }
  footer {
    padding-left: 20px;
    padding-right: 20px;
    align-items: flex-start;
    flex-direction: column;
  }
  .heading h1 {
    font-size: 27px;
  }
  .rename {
    flex-wrap: wrap;
  }
  .rename button {
    flex: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
