:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  background: #fbfbfb;
  color: #070707;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(#ececec 1px, transparent 1px),
    linear-gradient(90deg, #ececec 1px, transparent 1px),
    #fbfbfb;
  background-size: 40px 40px;
}

.shell {
  max-width: 1184px;
  margin: 0 auto;
  padding: 64px 24px;
}

.status-shell {
  position: relative;
}

.narrow {
  max-width: 720px;
  padding-top: 36px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 30px;
  padding: 0 18px;
  border: 1px solid #eeeeee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  color: #6f6f6f;
  font-size: 14px;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 44px;
}

.view-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: #737373;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: #050505;
  color: #fff;
  font-size: 19px;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 70px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: #6f6f6f;
  font-size: 13px;
}

.hero-meta {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 26px;
  color: #777;
  font-size: 13px;
}

.hero-meta span:first-child {
  position: relative;
  padding: 4px 10px 4px 21px;
  border-radius: 999px;
  background: #dcffe8;
  color: #088b35;
}

.hero-meta span:first-child::before {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00bf4f;
  content: "";
  transform: translateY(-50%);
}

.hero-side {
  display: grid;
  justify-items: end;
  gap: 12px;
  min-width: 260px;
  color: #777;
  font-size: 12px;
}

.operation-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 152px;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid #ededed;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #111;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #08bf50;
}

.update-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

button,
.link-button {
  border: 1px solid #e7e7e7;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #393939;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 7px 12px;
  text-decoration: none;
}

button:hover,
.link-button:hover {
  border-color: #cfcfcf;
  color: #000;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.group-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ededed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 20px 18px;
}

.card-head h2 {
  min-width: 0;
  margin: 0;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.status-badge {
  flex: 0 0 auto;
  margin-top: 5px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}

.status-badge.ok {
  background: #d9ffe8;
  color: #07923a;
  box-shadow: 0 2px 7px rgba(3, 151, 61, 0.14);
}

.status-badge.warn {
  background: #fff1cc;
  color: #a46d00;
}

.status-badge.bad {
  background: #ffe0df;
  color: #b51616;
}

.status-badge.muted {
  background: #eeeeee;
  color: #777;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 16px;
}

.mini-metric {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 248, 248, 0.84);
}

.mini-metric.metric-ok {
  background: #f5fff8;
}

.mini-metric.metric-warn {
  background: #fff8e6;
}

.mini-metric.metric-bad {
  background: #fff1f1;
}

.mini-metric.metric-muted {
  background: rgba(248, 248, 248, 0.84);
}

.mini-metric span,
.availability span,
.history-head,
.history-scale {
  color: #777;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.mini-metric strong {
  color: #121212;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  line-height: 1;
}

.availability {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 20px 18px;
  padding: 13px 12px;
  border-top: 1px solid #f0f0f0;
  border-radius: 12px;
  background: rgba(249, 249, 249, 0.82);
}

.availability strong {
  color: #00b936;
  font-size: 14px;
  font-weight: 900;
}

.history {
  margin-top: auto;
  padding: 16px 20px 17px;
  border-top: 1px solid #eeeeee;
  background: rgba(250, 250, 250, 0.72);
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  color: #595959;
  font-size: 10px;
}

.history-bars {
  display: grid;
  height: 28px;
  grid-template-columns: repeat(60, 1fr);
  gap: 3px;
}

.history-bars span {
  border-radius: 2px;
  background: #00c96b;
}

.history-bars .warn {
  background: #ffb000;
}

.history-bars .bad {
  background: #f64d45;
}

.history-bars .good {
  background: #00c96b;
}

.history-bars .empty {
  background: #e1e1e1;
}

.history-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: #b5b5b5;
  font-size: 10px;
}

.empty-board {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px solid #ededed;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: #777;
}

.form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
}

.compact-form {
  margin-top: 10px;
  border: 0;
  background: transparent;
  padding: 0;
}

.login-card {
  display: grid;
  gap: 12px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
}

.panel-section {
  margin-top: 12px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0 0 2px;
  font-size: 17px;
}

.channel-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid #ededed;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
}

.channel-item input {
  width: auto;
  min-height: auto;
}

.channel-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  color: #777;
}

.field {
  display: grid;
  gap: 6px;
  color: #555;
  font-size: 13px;
  min-width: 0;
}

.field-full,
.form-actions {
  grid-column: 1 / -1;
}

.field span {
  color: #222;
  font-weight: 700;
  line-height: 1.3;
}

input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #dddddd;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  min-height: 36px;
}

textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  border: 1px solid #dddddd;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 10px;
  min-height: 76px;
}

input::placeholder {
  color: #9a9a9a;
}

input:focus,
textarea:focus {
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
  outline: none;
}

@media (max-width: 960px) {
  .shell {
    padding: 36px 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    margin-bottom: 28px;
  }

  .hero-side {
    justify-items: start;
    min-width: 0;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 24px 14px;
  }

  .back-link {
    margin-bottom: 22px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-meta,
  .update-row,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .card-grid,
  .form,
  .channel-list {
    grid-template-columns: 1fr;
  }

  .group-card {
    min-height: 300px;
  }
}
