* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f3f6fb;
  color: #1c2434;
}
.hidden { display: none !important; }

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #12203a, #1f3e78 45%, #f3f6fb 45%);
}
.login-card {
  width: min(420px, 92vw);
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(10, 24, 56, 0.18);
  display: grid;
  gap: 12px;
}
.login-card h1 { margin: 0; }
.login-card p { margin: 0 0 8px; color: #66758f; }
.login-card label { display: grid; gap: 6px; color: #44506a; }
.login-err { color: #b42318; min-height: 20px; white-space: pre-wrap; }
.hint { color: #7a869f; font-size: 13px; }

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
.sidebar {
  background: #152033;
  color: #fff;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand-title { font-size: 24px; font-weight: 700; }
.brand-sub { color: #aab6d3; margin-top: 6px; font-size: 13px; }
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  background: transparent;
  color: #dce4f9;
  cursor: pointer;
  font-size: 15px;
}
.nav-item.primary { font-weight: 700; }
.nav-sep {
  margin: 10px 4px 4px;
  padding: 4px 10px;
  color: #8fa0c2;
  font-size: 12px;
}
.nav-item.active, .nav-item:hover { background: #2b68ff; color: #fff; }
.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-foot a { color: #dce4f9; text-decoration: none; }

.main { padding: 20px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0 0 6px; font-size: 28px; }
.topbar p { margin: 0; color: #6c7890; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

select, input, button { font: inherit; }
select, input {
  border: 1px solid #d6dceb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.view { display: none; gap: 16px; }
.view.active { display: grid; }
.cards { display: grid; gap: 16px; }
.cards-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(14, 30, 62, 0.06);
}
.panel-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.hero p { margin: 0 0 16px; color: #5d6a84; }

.metric {
  padding: 16px;
  background: linear-gradient(180deg, #f8fbff, #eef3ff);
  border-radius: 14px;
}
.metric .value { font-size: 28px; font-weight: 700; margin: 8px 0 4px; }
.metric .label { color: #5d6a84; font-size: 14px; }

.btn {
  border: 0;
  border-radius: 10px;
  background: #2b68ff;
  color: #fff;
  padding: 10px 16px;
  cursor: pointer;
}
.btn:hover { opacity: 0.92; }
.btn-light { background: #edf2ff; color: #2043b5; }
.btn-sm { padding: 8px 12px; font-size: 14px; }
.btn-danger { background: #fff0f0; color: #b42318; }

.form-panel { display: grid; gap: 14px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.form-grid label, .inline-row label {
  display: grid;
  gap: 8px;
  color: #44506a;
}
.span-2 { grid-column: span 2; }
.inline-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.result-box {
  margin: 0;
  background: #101725;
  color: #d5e2ff;
  border-radius: 12px;
  padding: 14px;
  min-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
}

.list { display: grid; gap: 10px; }
.item {
  border: 1px solid #e2e8f5;
  border-radius: 12px;
  padding: 12px;
  background: #fafcff;
}
.item-title { font-weight: 700; margin-bottom: 6px; }
.meta { color: #637089; font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  background: #eef3ff;
  color: #304db2;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.chip.bad { background: #fff0f0; color: #b42318; }
.chip.good { background: #ecfdf3; color: #027a48; }
.chip.warn { background: #fff7e8; color: #b54708; }

.preview-frame {
  width: 100%;
  min-height: 620px;
  border: 1px solid #e1e6f3;
  border-radius: 12px;
  background: #fff;
}
.source-box {
  width: 100%;
  min-height: calc(100vh - 320px);
  max-height: calc(100vh - 260px);
  overflow: auto;
  margin: 8px 0 0;
  padding: 12px 14px;
  border: 1px solid #e1e6f3;
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  resize: vertical;
  box-sizing: border-box;
}
.preview-actions {
  margin-top: 8px;
  flex-wrap: wrap;
}
.preview-editor[readonly] {
  opacity: 0.92;
  cursor: default;
}
.preview-editor.editing {
  outline: 2px solid #2b68ff;
  border-color: #2b68ff;
  opacity: 1;
}
#previewEditHint {
  margin-top: 6px;
}
#previewSaveMsg {
  margin-top: 8px;
  max-height: 12vh;
  overflow: auto;
}
.hidden { display: none !important; }

.tree-preview-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  min-height: 70vh;
}
.tree-panel {
  overflow: auto;
  max-height: calc(100vh - 220px);
}
.preview-panel .preview-frame {
  min-height: calc(100vh - 280px);
}
.sites-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.sites-inline .item.active-site {
  border-color: #2b68ff;
  background: #edf2ff;
}
.sites-inline .item {
  padding: 8px 10px;
  margin: 0;
}
.draw-tree {
  margin-top: 10px;
  max-height: 48vh;
  overflow: auto;
  border: 1px solid #e2e8f5;
  border-radius: 12px;
  padding: 8px;
  background: #fafcff;
}
.ft-folder,
.ft-file {
  user-select: none;
}
.ft-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.ft-row:hover {
  background: #eef3ff;
}
.ft-row.active {
  background: #dbe7ff;
  font-weight: 700;
}
.ft-folder {
  margin-left: 0;
}
.ft-folder > .ft-row.ft-folder-toggle {
  font-weight: 600;
}
.ft-toggle {
  width: 18px;
  text-align: center;
  color: #64748b;
  flex: 0 0 18px;
  font-size: 11px;
  line-height: 1;
}
.ft-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ft-children {
  margin-left: 14px;
  border-left: 1px dashed #d7deed;
  padding-left: 8px;
}
.ft-children.collapsed {
  display: none;
}
.ft-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef3ff;
  color: #304db2;
  flex: 0 0 auto;
}
.ft-badge.good { background: #ecfdf3; color: #027a48; }
.ft-badge.bad { background: #fff0f0; color: #b42318; }
.ft-badge.warn { background: #fff7e8; color: #b54708; }
.ft-check {
  flex: 0 0 auto;
}
.empty { color: #7a869f; }
.steps { display: flex; gap: 10px; flex-wrap: wrap; }
.step {
  background: #e8eefc;
  color: #3a4d7a;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}
.step.on { background: #2b68ff; color: #fff; }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rules-grid label {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f7f9ff;
  border-radius: 10px;
  padding: 12px;
}

.mobile-top { display: none; }
.mobile-bottom { display: none; }
.sidebar-mask { display: none; }

@media (max-width: 1100px) {
  #app {
    grid-template-columns: 1fr;
    padding-bottom: 72px;
  }

  .mobile-top {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #152033;
    color: #fff;
    padding: 10px 12px;
    margin: -12px -12px 12px;
  }
  .mobile-top-title {
    flex: 1;
    min-width: 0;
    display: grid;
  }
  .mobile-top-title strong {
    font-size: 16px;
  }
  .mobile-top-title span {
    font-size: 12px;
    color: #aab6d3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #243552;
    color: #fff;
    font-size: 18px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 82vw);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    overflow: auto;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 14, 28, 0.45);
    z-index: 30;
  }
  .sidebar-mask.show {
    display: block;
  }

  .main {
    padding: 12px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .topbar > div:first-child {
    display: none;
  }
  .topbar {
    flex-direction: column;
  }
  .topbar h1 {
    font-size: 22px;
  }
  .topbar-actions {
    width: 100%;
  }
  .topbar-actions select,
  .topbar-actions .btn {
    flex: 1;
    min-width: 0;
  }

  .cards-5,
  .cards-3,
  .cards-2,
  .form-grid,
  .rules-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: span 1;
  }

  .tree-preview-layout {
    grid-template-columns: 1fr;
  }
  .tree-panel {
    max-height: 42vh;
  }
  .preview-panel .preview-frame,
  .preview-frame {
    min-height: 420px;
  }
  .result-box {
    font-size: 12px;
    max-height: 40vh;
  }

  .mobile-bottom {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: #fff;
    border-top: 1px solid #e2e8f5;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(14, 30, 62, 0.08);
  }
  .m-tab {
    border: 0;
    background: transparent;
    color: #64748b;
    padding: 10px 4px;
    border-radius: 10px;
    font-size: 13px;
  }
  .m-tab.active {
    color: #2b68ff;
    background: #edf2ff;
    font-weight: 700;
  }
}

@media (min-width: 1101px) {
  .mobile-top,
  .mobile-bottom,
  .sidebar-mask {
    display: none !important;
  }
}

/* 开奖记录 */
.seg-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.seg-tab {
  border: 1px solid #d7e0f5;
  background: #f7f9ff;
  color: #44506a;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
}
.seg-tab.active {
  background: #2b68ff;
  border-color: #2b68ff;
  color: #fff;
  font-weight: 700;
}
.records-list {
  display: grid;
  gap: 12px;
}
.record-card {
  border: 1px solid #e4ebf8;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.record-card:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}
.record-card.selected {
  border-color: #2b68ff;
  background: #edf2ff;
  box-shadow: 0 0 0 2px rgba(43, 104, 255, 0.15);
}
.draw-summary {
  padding: 12px;
  border-radius: 12px;
  background: #f5f8ff;
  border: 1px solid #dbe4ff;
  margin-top: 8px;
}
#drawSiteSelect {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d7deed;
}
#drawerPreview.preview-frame {
  width: 100%;
  min-height: 60vh;
  border: 1px solid #e2e8f5;
  border-radius: 10px;
  background: #fff;
}
.record-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.record-head .meta { margin-left: 8px; }
.ball-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  line-height: 1.05;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
  background: linear-gradient(180deg, #adb5bd, #868e96);
}
.ball em { font-style: normal; font-size: 14px; }
.ball i { font-style: normal; font-size: 11px; opacity: .95; font-weight: 600; }
.ball-red { background: linear-gradient(180deg, #ff6b6b, #e03131) !important; }
.ball-blue { background: linear-gradient(180deg, #74c0fc, #1c7ed6) !important; }
.ball-green { background: linear-gradient(180deg, #8ce99a, #2f9e44) !important; }
.ball-gray { background: linear-gradient(180deg, #adb5bd, #868e96) !important; }
.ball-tema {
  outline: 2px solid #ffd43b;
  outline-offset: 2px;
}
.ball-plus {
  color: #8a97b3;
  font-weight: 700;
  margin: 0 2px;
}
.record-balls { margin-top: 2px; }

/* v13: templates / jobs drill / drawer / sites draw bar */
.templates-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 14px;
  align-items: start;
}
.draw-bar {
  margin-top: 14px;
  position: sticky;
  bottom: 12px;
  z-index: 5;
  box-shadow: 0 -8px 24px rgba(14, 30, 62, 0.08);
}
.manual-edit { margin-top: 10px; }
.manual-textarea {
  width: 100%;
  min-height: 360px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid #d7deed;
  border-radius: 10px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
}
.job-detail { min-height: 200px; }
.job-detail-head { max-height: 28vh; margin-bottom: 12px; }
.job-file-tables { display: grid; gap: 12px; }
.job-file-block .panel-title { margin-bottom: 6px; font-size: 14px; }
.job-file-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }
.job-file-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  border: 1px solid #e2e8f5;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
}
.job-file-row:hover { border-color: #93c5fd; background: #f8fbff; }
.job-file-row.ok { border-left: 3px solid #2f9e44; }
.job-file-row.fail { border-left: 3px solid #e03131; }
.job-file-row.skip { border-left: 3px solid #868e96; }
.job-file-path { word-break: break-all; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}
.drawer.hidden { display: none; }
.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 96vw);
  height: 100%;
  background: #fff;
  padding: 16px;
  overflow: auto;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cards-2 .panel.hero { min-height: 140px; }
.home-cta .hero-primary {
  border: 1px solid #c9d7ff;
  background: linear-gradient(180deg, #f7faff, #eef3ff);
}
.home-cta .hero-primary .panel-title { font-size: 22px; }
.draw-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: start;
}
.onboard-review-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.adv-block {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #c9d3ea;
  border-radius: 12px;
  background: #fafcff;
}
.adv-block summary {
  cursor: pointer;
  font-weight: 600;
  color: #3a4d7a;
  margin-bottom: 8px;
}
#onboardSteps .step {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.folder-picker {
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
  padding: 4px;
  border: 1px solid #e4ebf8;
  border-radius: 12px;
  background: #f8faff;
}
.folder-item {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  width: 100%;
  border: 1px solid #e2e8f5;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.folder-item:hover { border-color: #93c5fd; background: #f0f7ff; }
.folder-item.selected {
  border-color: #2b68ff;
  background: #edf2ff;
  box-shadow: 0 0 0 2px rgba(43, 104, 255, 0.12);
}
.folder-check {
  margin: 0;
}
.folder-check input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: #2b68ff;
}
.folder-picker-multi {
  max-height: 52vh;
}
.folder-icon { font-size: 22px; line-height: 1; }
.folder-name { font-weight: 600; font-size: 15px; color: #1c2434; }
.folder-meta { font-size: 12px; color: #637089; margin-top: 2px; }
.folder-body { flex: 1; min-width: 0; }
.draw-stack {
  display: grid;
  gap: 16px;
}
.draw-actions { margin-top: 14px; }
.btn-lg, #runDrawBtn {
  min-height: 48px;
  font-size: 17px;
  width: 100%;
  border-radius: 12px;
  font-weight: 700;
}
.sticky-action {
  position: sticky;
  top: 8px;
  z-index: 6;
  border: 1px solid #c9d7ff;
  background: linear-gradient(180deg, #ffffff, #f7faff);
}
.draw-summary {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #eef3ff);
  border: 1px solid #dbe4ff;
}
.jobs-layout { align-items: start; }
.job-item.active-job {
  border-color: #2b68ff;
  background: #edf2ff;
  box-shadow: 0 0 0 2px rgba(43, 104, 255, 0.12);
}
.job-stat-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.job-stat-card {
  border: 1px solid #e2e8f5;
  border-radius: 14px;
  padding: 18px 14px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-align: center;
  color: inherit;
}
.job-stat-card:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}
.job-stat-card.ok { border-left: 4px solid #2f9e44; }
.job-stat-card.fail { border-left: 4px solid #e03131; }
.job-stat-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.job-retry-beside {
  width: 100%;
  min-height: 40px;
  font-weight: 700;
}
.job-retry-bar {
  margin-bottom: 10px;
}
.job-fail-tools {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.job-fail-tools .btn.is-active,
#jobsMultiBtn.is-active {
  background: #1c2434;
  color: #fff;
  border-color: #1c2434;
}
.job-item-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.job-item-main {
  flex: 1;
  min-width: 0;
}
.job-list-check {
  margin-top: 4px;
}
.job-fail-check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  padding: 0 2px;
  cursor: pointer;
}
.job-fail-check-wrap input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.job-file-row-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.job-file-row-wrap .job-file-row {
  flex: 1;
  min-width: 0;
}
.job-retry-one {
  flex-shrink: 0;
  align-self: center;
  min-width: 56px;
}
.job-stat-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  color: #1c2434;
}
.job-stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: #637089;
}
.job-file-list-full {
  max-height: min(70vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
}
#jobsBackBtn { flex-shrink: 0; }
.job-item:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}
.job-item .item-title { color: #1c2434; }
.job-detail .empty { padding: 24px; text-align: center; }
.job-detail-head {
  background: #101725 !important;
  color: #d5e2ff !important;
  border-radius: 12px;
  min-height: auto;
}
.job-file-block {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #fafcff;
  border: 1px solid #e2e8f5;
}
.job-file-block .panel-title {
  font-size: 15px;
  color: #304db2;
}
#sitesList.sites-inline .site-pick,
.sites-inline .site-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f5;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fafcff;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  margin: 0;
}
#sitesList.sites-inline .site-pick:hover,
.sites-inline .site-pick:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}
#sitesList.sites-inline .site-pick.selected,
.sites-inline .site-pick.selected,
#sitesList.sites-inline .site-pick.active-site,
.sites-inline .site-pick.active-site {
  border-color: #2b68ff;
  background: #edf2ff;
  box-shadow: 0 0 0 2px rgba(43, 104, 255, 0.12);
}
.site-check-input,
.file-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: #2b68ff;
}
.site-pick-body {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.ft-check {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  cursor: pointer;
}
.ft-check.selected {
  background: #edf2ff;
  border-radius: 8px;
}
.ft-name-btn {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 4px 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ft-name-btn:hover {
  color: #2b68ff;
}
#usersList .item,
#onboardResult.result-box,
#importResult.result-box,
#rulesResult.result-box,
#drawResult.result-box {
  border-radius: 12px;
}
.rule-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f5;
  border-radius: 12px;
  background: #fafcff;
  color: #44506a;
}
.rules-grid {
  gap: 12px;
  margin-bottom: 14px;
}
#view-onboard .panel-head {
  flex-wrap: wrap;
}
#view-onboard .panel-title,
#view-draw .panel-title,
#view-jobs .panel-title,
#view-sites .panel-title,
#view-rules .panel-title,
#view-users .panel-title {
  color: #1c2434;
}
.drawer-actions {
  margin: 10px 0 6px;
  flex-wrap: wrap;
}
.drawer-editor {
  width: 100%;
  min-height: 42vh;
  resize: vertical;
  border: 1px solid #d7deed;
  border-radius: 10px;
  padding: 10px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  background: #0f172a;
  color: #e2e8f0;
}
.drawer-editor[readonly] {
  opacity: 0.92;
  cursor: default;
}
.drawer-editor.editing {
  outline: 2px solid #2b68ff;
  border-color: #2b68ff;
  opacity: 1;
}
.drawer-save-msg {
  margin-top: 8px;
  max-height: 12vh;
  overflow: auto;
}
#drawerEditHint {
  margin-bottom: 6px;
}
.drawer-head strong { color: #1c2434; font-size: 18px; }
#drawerReason {
  color: #b42318;
  background: #fff0f0;
  border-radius: 10px;
  padding: 8px 10px;
}
#drawerReason:empty { display: none; padding: 0; }

@media (max-width: 1100px) {
  .sticky-action {
    top: 52px;
  }
  .folder-picker { max-height: 36vh; }
  .jobs-layout.draw-layout {
    grid-template-columns: 1fr;
  }
  .jobs-layout:not(.drilled) #jobsDetailPanel {
    display: none;
  }
  .jobs-layout.drilled #jobsListPanel {
    display: none;
  }
  .records-list {
    max-height: 50vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cards-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
