:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #182625;
  background: #f6f8f7;
  --muted: #5d6b69;
  --line: #dce4e1;
  --green: #126d56;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: inherit;
  padding: 8px 12px;
  cursor: pointer;
}
button:hover { background: #f0f6f3; border-color: #9fbbb0; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #417f6d;
  outline-offset: 2px;
}
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover { background: #105b49; color: white; }
.danger { color: #a32e34; }
.shell { display: grid; grid-template-columns: 204px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: white;
  border-right: 1px solid var(--line);
  padding: 24px 16px;
}
.brand { font-size: 18px; font-weight: 750; margin: 0 8px 18px; }
.sidebar button {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 8px;
  text-align: left;
  border-color: transparent;
}
.sidebar button.active { background: #e9f2ed; color: #154f40; font-weight: 650; }
.sidebar > .module-switcher { border-block: 1px solid var(--line); margin: 12px 0; padding: 8px 0; }
.sidebar nav { margin-bottom: 12px; }
.main { min-width: 0; padding: 0 28px 28px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 60px; border-bottom: 1px solid var(--line); }
.top .right, .toolbar, .tabs, .dialog-actions, .pager, .inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top small { color: var(--muted); }
#content { padding-top: 20px; }
h1 { font-size: 24px; margin: 0 0 10px; }
h2 { font-size: 19px; margin: 0; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.lead { color: var(--muted); line-height: 1.55; margin: 0 0 16px; }
.lead:empty { display: none; }
.toolbar { margin: 12px 0; }
.tabs { margin: 0 0 12px; }
.tabs .selected { background: #e9f2ed; border-color: #aac8ba; color: #154f40; }
input:not([type="checkbox"]), select, textarea { min-width: 0; padding: 8px 10px; border: 1px solid #cbd6d1; border-radius: 6px; background: white; color: inherit; }
select {
  appearance: none;
  padding-inline-end: 32px;
  background-image: linear-gradient(45deg, transparent 50%, #4e645e 50%), linear-gradient(135deg, #4e645e 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
button:focus-visible, select:focus-visible { outline-offset: -3px; }
button.primary:focus-visible { outline-color: white; }
@media (forced-colors: active) {
  select { appearance: auto; background-image: none; }
  button.primary:focus-visible { outline-color: Highlight; }
}
input[type="checkbox"] { accent-color: var(--green); }
label { display: block; margin: 10px 0 5px; color: var(--muted); font-size: 13px; }
textarea { width: 100%; min-height: 150px; resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: #f8faf9; color: #495b56; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
td button { padding: 5px 8px; margin: 2px 4px 2px 0; font-size: 13px; white-space: nowrap; }
.work-list table, .shell[data-module="earn"] #content table { min-width: 790px; }
.work-list :is(th, .tag), .shell[data-module="earn"] #content :is(th, .tag) { white-space: nowrap; }
.work-row-actions { display: flex; align-items: center; gap: 6px; }
.work-row-actions button { margin: 0; min-height: 30px; }
.publication-languages { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; }
.publication-languages label { display: inline-flex; align-items: center; gap: 4px; margin: 4px 14px 4px 0; }
.tag { display: inline-block; background: #e9f2ed; color: #23634e; border-radius: 4px; padding: 3px 6px; font-size: 12px; }
.tag.warn { background: #fff5df; color: #7b5709; }
.tag.bad { background: #fbecee; color: #a32e34; }
.empty, .notice, .error { margin: 8px 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); font-size: 13px; line-height: 1.5; }
.error { background: #fff3f3; color: #a32e34; border-color: #edcbce; white-space: pre-wrap; }
pre { overflow: auto; max-height: 450px; padding: 12px; background: #f5f7f6; border: 1px solid var(--line); border-radius: 6px; }
dialog { border: 1px solid var(--line); border-radius: 8px; padding: 20px; width: min(92vw, 880px); max-height: 88vh; }
dialog::backdrop { background: #10272061; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dialog-head > h2 { min-width: 0; overflow-wrap: anywhere; }
.dialog-head > button { flex: 0 0 auto; white-space: nowrap; }
.dialog-actions, .pager { justify-content: flex-end; margin-top: 14px; }
.pager, .status-line { color: var(--muted); font-size: 13px; }
.content-intake-form input:not([type="checkbox"]), .content-intake-form select { width: 100%; }
.content-intake-form textarea { min-height: 72px; }
.content-intake-form fieldset { min-width: 0; margin: 10px 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.content-intake-form fieldset > button { margin-top: 10px; }
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-box { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 24px; width: min(100%, 400px); }
.login-box input, .login-box form > button { width: 100%; }
.login-box form > button { margin-top: 16px; }
.boot { text-align: center; padding: 28px; color: var(--muted); }
.cards, .module-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 12px 0; }
.metric, .module-card { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 16px; }
.metric strong { display: block; font-size: 22px; }
.module-card p { color: var(--muted); line-height: 1.55; }
a { color: var(--green); }
#toast { display: none; position: fixed; bottom: 16px; right: 16px; z-index: 5; max-width: 80vw; border-radius: 6px; background: #184d3f; color: white; padding: 10px 14px; }
@media (max-width: 780px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar button { display: inline-block; width: auto; white-space: nowrap; }
  .sidebar nav { display: flex; overflow: auto; margin-bottom: 4px; }
  .shell[data-module="earn"] #module-nav { flex-wrap: wrap; }
  .sidebar > .module-switcher { margin: 6px 0; padding: 4px 0; }
  .brand { margin-bottom: 8px; }
  .main { padding: 0 12px 20px; }
  .top small { display: none; }
  th, td { padding: 7px 8px; }
}
@media (max-width: 530px) {
  .grid { grid-template-columns: 1fr; }
}

.program-picker { margin: 16px 0; }

.toolbar:has(> .form-field) { align-items: flex-end; }
.toolbar > .form-field { min-width: 0; max-width: 100%; }
.toolbar > .form-field > select { display: block; }
.toolbar > .form-field :is(select, input:not([type="checkbox"])),
.toolbar:has(> .form-field) > :is(button, input:not([type="checkbox"])) {
  min-height: 38px;
  max-width: 100%;
}
.scene-members:not(:empty) { margin: 12px 0; }
.scene-members summary { cursor: pointer; padding: 6px 0; }
.work-json {
  display: block;
  min-height: 180px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  tab-size: 2;
}
