:root {
  color-scheme: light;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #20252b;
  background: #f5f7f8;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background: #f5f7f8;
}

body.modal-open {
  overflow: hidden;
}

button {
  font: inherit;
  letter-spacing: 0;
}

.topbar {
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #ffffff;
  border-bottom: 1px solid #d9dee2;
}

.brand {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  color: #66717c;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d8a63;
}

.identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-label {
  color: #66717c;
  font-size: 14px;
}

main {
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.page-heading {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #2d6d57;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
}

.service-list {
  border-top: 1px solid #cdd3d8;
}

.utility-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 0;
  font-size: 13px;
}

.utility-links a {
  color: #245d4a;
  font-weight: 700;
}

.service-row {
  min-height: 132px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px 4px;
  border-bottom: 1px solid #cdd3d8;
}

.service-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

.sonolus-mark {
  background: #2c3742;
}

.jellyfin-mark {
  background: #3d6f77;
}

.service-copy {
  min-width: 0;
}

.service-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.service-title-line h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.service-copy p {
  margin: 7px 0 0;
  color: #66717c;
  font-size: 14px;
  line-height: 1.6;
}

.badge {
  padding: 2px 7px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge.preparing {
  color: #7b5b13;
  background: #fff8df;
  border-color: #e8d493;
}

.badge.stopped {
  color: #7a4040;
  background: #fff0ef;
  border-color: #e5b9b6;
}

.badge.running {
  color: #225f46;
  background: #eaf7f0;
  border-color: #a8d5bf;
}

.badge.starting,
.badge.stopping,
.badge.partial,
.badge.unknown {
  color: #6c581b;
  background: #fff8df;
  border-color: #e8d493;
}

.badge.failed {
  color: #7a4040;
  background: #fff0ef;
  border-color: #e5b9b6;
}

.service-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: #34414a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.service-toggle[hidden] {
  display: none;
}

.service-toggle input {
  width: 36px;
  height: 20px;
  margin: 0;
  accent-color: #245d4a;
  cursor: pointer;
}

.command {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.command:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid #8db7e8;
  outline-offset: 2px;
}

.command.primary {
  color: #ffffff;
  background: #245d4a;
}

.command.primary:hover {
  background: #194b3b;
}

.command.secondary,
.command.ghost {
  color: #26313a;
  background: #ffffff;
  border-color: #bfc7ce;
}

.command.secondary:hover,
.command.ghost:hover {
  background: #eef2f4;
}

.modal-layer[hidden] {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(18 24 29 / 58%);
}

.notice {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgb(0 0 0 / 22%);
}

.notice-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  color: #ffffff;
  background: #2d6d57;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
}

.notice h2 {
  margin: 0;
  padding-right: 24px;
  font-size: 19px;
  line-height: 1.5;
}

.notice p {
  margin: 10px 0 0;
  color: #59656f;
  font-size: 14px;
  line-height: 1.7;
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #53606b;
  background: transparent;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.icon-button:hover {
  background: #edf1f3;
}

.notice-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.login-form {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.login-form[hidden] {
  display: none;
}

.login-form label {
  color: #34414a;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #bfc7ce;
  border-radius: 5px;
  color: #20252b;
  background: #ffffff;
  font: inherit;
}

.login-form input:focus-visible {
  outline: 3px solid #8db7e8;
  outline-offset: 1px;
}

.login-form .command {
  margin-top: 8px;
}

@media (max-width: 600px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .identity {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }

  main {
    padding-top: 38px;
  }

  h1 {
    font-size: 24px;
  }

  .service-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 14px;
  }

  .service-mark {
    width: 42px;
    height: 42px;
  }

  .service-row > .command {
    grid-column: 1 / -1;
    width: 100%;
  }

  .notice {
    padding: 24px 20px;
  }
}
