:root {
  color-scheme: dark;
  --bg: #0e0f10;
  --panel: #17191b;
  --panel-hover: #1d2023;
  --text: #f2f2ee;
  --muted: #a6aaa5;
  --subtle: #72776f;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #dfe8dd;
  --warn: #e9c46a;
  --error: #f28482;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.055), transparent 34rem),
    linear-gradient(145deg, #0b0c0d 0%, var(--bg) 62%, #111310 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.shell {
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 42px;
}

.admin-shell {
  width: min(760px, calc(100% - 32px));
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  min-height: 34px;
}

.top-nav a {
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--subtle);
  font-size: 0.88rem;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.status-message {
  margin: 18px auto 0;
  max-width: 720px;
  color: var(--muted);
  text-align: center;
}

.status-message:empty {
  display: none;
}

.status-message.error {
  color: var(--error);
}

.panel-stack {
  display: grid;
  gap: 28px;
  margin-top: clamp(56px, 14vh, 132px);
}

.service-section {
  display: grid;
  justify-items: center;
}

.service-grid {
  display: grid;
  width: 100%;
  gap: 18px;
}

.user-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 210px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(23, 25, 27, 0.88);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.admin-card {
  min-height: 174px;
  padding: 24px;
}

a.service-card:hover,
a.service-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--panel-hover);
  outline: none;
}

.service-badge {
  width: fit-content;
  margin-bottom: 22px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.service-name {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 720;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.admin-card .service-name {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.service-description {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
}

.service-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.service-port {
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

.service-action {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.86rem;
}

.service-card.disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.72;
}

.service-card.disabled .service-action {
  color: #1a1710;
  background: var(--warn);
}

.service-card.missing .service-action {
  color: #1f1010;
  background: var(--error);
}

.service-note {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty-message {
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .shell,
  .admin-shell {
    width: min(100% - 24px, 980px);
    padding-top: 14px;
  }

  .top-nav {
    justify-content: flex-end;
  }

  .panel-stack {
    margin-top: 38px;
  }

  .user-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .service-card,
  .admin-card {
    min-height: 168px;
    padding: 22px;
    border-radius: 20px;
  }

  .service-badge {
    margin-bottom: 18px;
  }
}
