:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;
  background: #0b1220;
  color: #e6edf3;
}

body { margin: 0; }
.container { max-width: 1200px; margin: 20px auto; padding: 0 16px 40px; }

h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 10px; opacity: 0.95; }

.card {
  background: #111a2e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.subcard{
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.kanban{
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 360px);
  gap: 12px;
  margin-top: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) rgba(255,255,255,0.08);
}
.kanban::-webkit-scrollbar{
  height: 8px;
}
.kanban::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
}
.kanban::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
}
.kanban .subcard{
  margin-top: 0;
  scroll-snap-align: start;
}
@media (max-width: 900px){
  .kanban{
    grid-auto-flow: row;
    grid-auto-columns: 1fr;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.hidden { display: none; }

.row { display: flex; gap: 12px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

input[type="file"]{
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: #e6edf3;
  flex: 1;
}

button{
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #e6edf3;
  cursor: pointer;
}
button:hover{ background: rgba(255,255,255,0.10); }
button.primary{ background: #2b6df6; }
button.primary:hover{ background: #245bd1; }

.status{
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.status.ok{ border-color: rgba(46, 204, 113, 0.35); }
.status.err{ border-color: rgba(231, 76, 60, 0.35); }
.status.info{ border-color: rgba(52, 152, 219, 0.35); }

.select{
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: #e6edf3;
}
.select option{
  color: #0b1220;
  background: #f8fafc;
}
.mapSelectWrap{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mapFilter{
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: #e6edf3;
}
.presetBar{
  margin-top: 8px;
}
.presetRow{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.presetGroup{
  flex: 1 1 320px;
}
.presetGroup label{
  display: block;
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 6px;
}
.presetControls{
  display: flex;
  gap: 10px;
  align-items: center;
}
.presetInput{
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: #e6edf3;
}
.mapGridWrap{
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 8px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) rgba(255,255,255,0.08);
}
.mapGridWrap::-webkit-scrollbar{
  height: 8px;
}
.mapGridWrap::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
}
.mapGridWrap::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
}
.mapGrid{
  display: grid;
  grid-template-columns: minmax(220px, 320px) repeat(var(--file-count), minmax(280px, 360px));
  min-width: 100%;
}
.mapGrid .cell{
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.mapGrid .cell.head{
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  font-weight: 600;
}
.mapGrid .headTitle{
  font-size: 12px;
  font-weight: 600;
}
.mapGrid .headSub{
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}
.mapGrid .cell.sticky{
  position: sticky;
  left: 0;
  z-index: 2;
  background: #111a2e;
}
.mapGrid .cell.head.sticky{
  z-index: 3;
}
.rowHeadInner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rowLabel{
  display: inline-block;
}
.rowToggle{
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 auto;
}
.rowToggle input{
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.rowToggleSlider{
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.rowToggleSlider:before{
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}
.rowToggle input:checked + .rowToggleSlider{
  background: rgba(46, 204, 113, 0.55);
}
.rowToggle input:checked + .rowToggleSlider:before{
  transform: translateX(16px);
}
.rowHeadCell.row-disabled .rowLabel{
  opacity: 0.6;
}
.map-cell.row-disabled{
  opacity: 0.6;
}
.mapFilter:disabled,
.mapSelect:disabled{
  opacity: 0.6;
  cursor: not-allowed;
}
@media (max-width: 900px){
  .mapGrid{
    grid-template-columns: minmax(180px, 240px) repeat(var(--file-count), minmax(240px, 300px));
  }
}

.pillbox{
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.tableWrap{ overflow: auto; margin-top: 10px; }
.table{
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td{
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  vertical-align: top;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.table th{ font-size: 12px; opacity: 0.9; }
.table td{ font-size: 13px; }

.map-cell.match-auto{
  background: rgba(46, 204, 113, 0.10);
  box-shadow: inset 3px 0 0 rgba(46, 204, 113, 0.70);
}
.map-cell.match-other{
  background: rgba(255, 193, 7, 0.08);
  box-shadow: inset 3px 0 0 rgba(255, 193, 7, 0.65);
}

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.hint{ opacity: 0.85; font-size: 12px; margin-top: 10px; }
.checkbox{ font-size: 13px; opacity: 0.9; }
