:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #5b6472;
  --line: #d9dee7;
  --surface: #ffffff;
  --soft: #f4f7fa;
  --red: #c92a2a;
  --teal: #007f7f;
  --amber: #f4b942;
  --green: #1f8a4c;
  --blue: #2e5aac;
  --shadow: 0 18px 44px rgba(16, 24, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 20px;
  width: 282px;
  height: 100vh;
  padding: 20px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand > div {
  min-width: 0;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
}

.brand h1,
.section-heading h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 1.04rem;
  line-height: 1.18;
  white-space: normal;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tabs {
  display: grid;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.tab {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
}

main {
  width: min(1680px, calc(100vw - 326px));
  margin: 28px 24px 56px 302px;
}

.beta-overview {
  display: grid;
  grid-template-columns: 1.15fr repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.beta-card {
  min-width: 0;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

.beta-card span,
.beta-card small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.beta-card strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.05;
}

.beta-card-strong {
  border-color: rgba(201, 42, 42, 0.42);
  background: linear-gradient(135deg, rgba(201, 42, 42, 0.12), #fff 62%);
}

.beta-card-strong strong {
  color: var(--red);
  text-transform: uppercase;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 2rem;
  line-height: 1.12;
}

.status-pill,
.panel-title span,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}

.status-pill.is-ok {
  color: var(--green);
}

.status-pill.is-error {
  color: var(--red);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-grid-wide {
  grid-template-columns: repeat(8, minmax(132px, 1fr));
}

.metric {
  min-height: 124px;
  padding: 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1;
}

.metric small,
.notice small,
.list-item small,
.data-table small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.content-grid,
.form-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: 18px;
}

.second-row {
  margin-top: 18px;
}

.module-spacer {
  margin-top: 18px;
}

.three-grid,
.training-grid,
.command-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.panel,
.command-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.table-panel {
  overflow: hidden;
}

.table-panel .table-wrap {
  margin: 0 -18px -18px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}

.table-panel .data-table {
  min-width: 100%;
  font-size: 0.94rem;
  table-layout: fixed;
}

.table-panel .data-table th,
.table-panel .data-table td {
  padding: 12px 14px;
  overflow-wrap: break-word;
  word-break: normal;
}

.table-panel .data-table th:nth-child(1),
.table-panel .data-table td:nth-child(1) {
  width: 15%;
}

.table-panel .data-table th:nth-child(2),
.table-panel .data-table td:nth-child(2) {
  width: 13%;
}

.table-panel .data-table th:nth-child(3),
.table-panel .data-table td:nth-child(3) {
  width: 16%;
}

.table-panel .data-table th:nth-child(4),
.table-panel .data-table td:nth-child(4) {
  width: 10%;
  overflow-wrap: normal;
  white-space: nowrap;
}

.table-panel .data-table th:nth-child(5),
.table-panel .data-table td:nth-child(5) {
  width: 18%;
}

.table-panel .data-table th:nth-child(6),
.table-panel .data-table td:nth-child(6) {
  width: 12%;
}

.table-panel .data-table th:nth-child(7),
.table-panel .data-table td:nth-child(7) {
  width: 16%;
}

.table-panel .badge {
  min-height: 26px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h3 {
  font-size: 1rem;
}

.panel-title span {
  background: #eef2f6;
  color: var(--muted);
}

.stack,
.timeline {
  display: grid;
  gap: 10px;
}

.compact-stack {
  max-height: 430px;
  overflow: auto;
}

.wide-list {
  max-height: 640px;
  overflow: auto;
}

.notice,
.list-item,
.timeline-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.notice.warning,
.notice.critical {
  border-left-color: var(--amber);
}

.notice.success {
  border-left-color: var(--green);
}

.list-item.compact {
  padding: 12px;
}

.notice strong,
.list-item strong,
.timeline-item strong {
  display: block;
  margin-bottom: 4px;
}

.notice p,
.list-item p,
.timeline-item p,
.command-card p,
.command-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.item-line {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.mini-action {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 850;
  padding: 0 10px;
}

.mini-action:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.mini-action.danger:hover {
  border-color: var(--red);
  color: var(--red);
}

.mini-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

.toolbar {
  margin-bottom: 14px;
}

.search-field,
.form-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.search-field {
  max-width: 480px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 127, 127, 0.14);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.log-table {
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.badge {
  background: #eef2f6;
  color: var(--ink);
}

.badge.active {
  background: rgba(31, 138, 76, 0.12);
  color: var(--green);
}

.badge.alert {
  background: rgba(244, 185, 66, 0.2);
  color: #7a5200;
}

.badge.danger {
  background: rgba(201, 42, 42, 0.12);
  color: var(--red);
}

.date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.primary-action:hover {
  background: #a92222;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.command-card {
  min-height: 154px;
  padding: 18px;
}

.one-column {
  grid-template-columns: 1fr;
}

.discord-category-panel {
  margin-top: 18px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.category-card {
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.channel-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.channel-list div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 32px;
  border-top: 1px solid #edf1f5;
  padding-top: 8px;
}

.channel-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.channel-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-card strong {
  display: block;
  margin-bottom: 12px;
  color: var(--red);
  font-size: 1.05rem;
}

.made-by {
  position: fixed;
  right: 12px;
  bottom: 10px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(201, 42, 42, 0.72);
  border-radius: 999px;
  background: rgba(18, 5, 8, 0.92);
  color: #f2d8dc;
  font-size: 10px;
  line-height: 12px;
  text-decoration: none;
  text-transform: none;
}

.made-by:hover {
  border-color: #ff6b6b;
  color: #fff;
}

.made-by img {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  object-fit: cover;
}

.made-by strong {
  max-width: 180px;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.made-by-version {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid rgba(255, 107, 107, 0.52);
  border-radius: 999px;
  background: rgba(201, 42, 42, 0.24);
  color: #ffd8dc;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.made-by-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 107, 107, 0.38);
}

.made-by-profile {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}

.made-by-profile:hover strong {
  color: #ffd8dc;
}

@media (max-width: 1280px) {
  .metric-grid-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .content-grid,
  .form-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-header {
    height: auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
  }

  .brand {
    min-width: 0;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .tab {
    width: auto;
    min-width: max-content;
    text-align: center;
  }

  main {
    width: min(100% - 40px, 1320px);
    margin: 24px auto 56px;
  }
}

@media (max-width: 880px) {
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  main {
    width: min(100% - 24px, 760px);
    margin-top: 18px;
  }

  .metric-grid,
  .metric-grid-wide,
  .beta-overview,
  .content-grid,
  .form-layout,
  .three-grid,
  .training-grid,
  .command-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-header {
    padding: 14px;
  }

  .brand h1 {
    font-size: 1rem;
    white-space: normal;
  }

  .section-heading h2 {
    font-size: 1.55rem;
  }

  .made-by {
    right: 8px;
    bottom: 8px;
    max-width: calc(100vw - 16px);
  }

  .date-row,
  .item-line {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
