:root {
  --accent: #16884f;
  --ink: #1a1d21;
  --muted: #8b919a;
  --line: #eceef1;
  --hover: #f6f7f8;
  --active: #f2f4f6;
  --paper: #fff;
  --top-h: 72px;
  --side-w: 252px;
  --bottom-h: 40px;
  --font: "SCoreDream", "S-CoreDream", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: -0.02em;
}

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: var(--top-h) 1fr var(--bottom-h);
  grid-template-areas:
    "top top"
    "side stage"
    "bottom bottom";
  background: #fff;
}

.top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: none;
}
.ci {
  height: 34px;
  width: auto;
  display: block;
}
.brand-rule {
  width: 1px;
  height: 22px;
  background: #e4e7eb;
  flex: none;
}
.brand strong {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.modules {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}
.modules button {
  border: 0;
  background: transparent;
  color: #5c6570;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
.modules button.on {
  background: var(--ink);
  color: #fff;
}
.modules button:hover:not(.on) { background: var(--hover); color: var(--ink); }

.side {
  grid-area: side;
  background: #fff;
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 22px 14px 28px;
}
.side-title {
  margin: 0 12px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: -0.02em;
}
.group-label {
  margin: 18px 12px 6px;
  font-size: 11px;
  font-weight: 500;
  color: #b0b6be;
  letter-spacing: 0.04em;
}
#menus button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #3a4149;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}
#menus button.on {
  background: var(--active);
  color: var(--ink);
  font-weight: 600;
}
#menus button:hover:not(.on) { background: var(--hover); }

.stage {
  grid-area: stage;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #fff;
}
.stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.stage iframe[hidden], .common[hidden] { display: none !important; }
.common {
  position: absolute;
  inset: 0;
  overflow: auto;
  background: #fff;
  padding: 28px 32px 40px;
}
.common-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 18px; }
.common-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.04em; }
.common-head p { margin: 6px 0 0; max-width: 720px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.toolbar, .editor { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.editor {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.field.grow { flex: 1; min-width: 180px; }
.field span { font-size: 11px; color: var(--muted); }
.field input, .field select {
  height: 36px;
  border: 1px solid #e4e7eb;
  border-radius: 9px;
  padding: 0 10px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.btn {
  height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 0 14px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #e4e7eb; }
.btn.warn { background: #fff; color: #b42318; border: 1px solid #f3d0cc; }
.note { min-height: 18px; margin: 0 0 12px; font-size: 13px; color: var(--accent); }
.note.bad { color: #b42318; }
.table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 500; background: #fafbfc; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.on td { background: #f7f8f9; }
table.data button.link { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 420px; }
.groups { border: 1px solid var(--line); border-radius: 14px; overflow: auto; }
.groups button.item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
}
.groups button.item.on { background: #f4f5f7; }
.groups button.item small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.check { display: flex; align-items: center; gap: 6px; height: 36px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.stat b { display: block; font-size: 22px; letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.filters button {
  height: 32px;
  border: 1px solid #e4e7eb;
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: #f4f5f7; color: var(--muted); font-size: 11px; }
.offline {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}
.offline[hidden] { display: none !important; }

.bottom {
  grid-area: bottom;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}
.status { display: flex; gap: 12px; overflow-x: auto; white-space: nowrap; }
.status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #d5d9de;
  vertical-align: 1px;
}
.status i.on { background: var(--accent); }

button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}
