:root {
  color-scheme: light;
  --bg: #0b1020;
  --card: #111935;
  --text: #e8ecff;
  --muted: #aab2d6;
  --accent: #7aa2ff;
  --border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 10% -10%, #1d2a66, transparent),
    radial-gradient(1200px 700px at 110% 10%, #2a1d66, transparent),
    var(--bg);
  color: var(--text);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.sub {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
}

.row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.label {
  color: var(--muted);
}

input[type="text"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

input[type="file"] {
  width: 100%;
}

.actions {
  display: flex;
  gap: 10px;
  padding-top: 10px;
}

.m2sLayout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  align-items: start;
  padding-top: 12px;
}

.m2sSheet {
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: auto;
  min-height: 420px;
}

.m2sSide {
  position: sticky;
  top: 12px;
}

.m2sNoteList {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.m2sChip {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.m2sChip.active {
  border-color: rgba(122, 162, 255, 0.9);
  background: rgba(122, 162, 255, 0.15);
}

@media (max-width: 860px) {
  .m2sLayout {
    grid-template-columns: 1fr;
  }
  .m2sSide {
    position: static;
  }
}

@media print {
  /* Keep only the staff sheet visible when printing from the main page. */
  .header,
  .card:not(#staffEditor),
  #staffEditor .m2sSide,
  #staffEditor h2,
  #staffEditor .row,
  #status,
  #debug,
  #analyze,
  #download,
  #printStaff {
    display: none !important;
  }
  body {
    background: #fff !important;
  }
  .page {
    max-width: none;
    padding: 0;
  }
  #staffEditor {
    border: none;
    background: #fff;
    padding: 0;
  }
  .m2sSheet {
    border: none;
    padding: 0;
    overflow: visible;
  }
  #osmd {
    overflow: visible;
  }
}

button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  padding-top: 12px;
}

.statusText {
  color: var(--muted);
  line-height: 1.4;
}

.debug {
  margin: 12px 0 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: #cfe0ff;
  overflow: auto;
  max-height: 200px;
}

ul {
  margin: 10px 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}
