:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #111827;
  --panel-2: #172235;
  --line: #2a3952;
  --text: #f8fbff;
  --muted: #9fb0c9;
  --accent: #17b3a6;
  --accent-2: #695cff;
  --warn: #f7c948;
  --danger: #ff6170;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #182235 0, #070b12 42%);
  color: var(--text);
  font-family: Arial, "Yu Gothic", "Meiryo", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1880px, calc(100vw - 48px));
  margin: 48px auto;
  border: 1px solid var(--line);
  background: rgba(10, 16, 27, 0.94);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 22px;
}

.status {
  color: #44f38b;
  font-size: 13px;
  white-space: nowrap;
}

.controls,
.summary,
.table-wrap,
.raw-box {
  margin: 18px 28px;
}

.controls {
  display: grid;
  grid-template-columns: 180px 130px;
  align-items: end;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

label,
.summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b1220;
  color: var(--text);
  padding: 0 12px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--text);
}

.check input {
  min-height: auto;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent-2);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 160px);
  gap: 12px;
}

.summary > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.summary strong {
  font-size: 24px;
}

.table-wrap {
  border: 1px solid var(--line);
  background: #090f1b;
}

.table-toolbar {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.table-scroll {
  max-height: calc(100vh - 360px);
  min-height: 360px;
  overflow: auto;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

th,
td {
  max-width: 360px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: #d9e7ff;
}

td {
  color: #edf5ff;
  word-break: break-word;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-active {
  background: rgba(42, 226, 134, 0.16);
  color: #44f38b;
}

.badge-planned {
  background: rgba(247, 201, 72, 0.16);
  color: var(--warn);
}

.badge-ended,
.badge-disabled {
  background: rgba(255, 97, 112, 0.14);
  color: var(--danger);
}

a {
  color: #8fc7ff;
}

.raw-box {
  border: 1px solid var(--line);
  background: #070d18;
}

.raw-box summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 700;
}

pre {
  margin: 0;
  max-height: 280px;
  overflow: auto;
  padding: 14px;
  color: #d9e7ff;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .app-shell {
    width: calc(100vw - 24px);
    margin: 12px auto;
  }

  .app-header,
  .controls,
  .summary,
  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .app-header {
    display: grid;
  }

  .summary {
    grid-template-columns: 1fr;
  }
}
