.cm-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}

.cm-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px;
  border-radius:10px;
  background:rgba(255,255,255,0.06);
}

.cm-card-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-card-name{
  font-weight:700;
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cm-card-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  font-size:12px;
  opacity:0.82;
}

.cm-card-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:2px;
}

.cm-chip{
  padding:2px 8px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.10);
  font-size:11px;
  opacity:0.95;
}

.cm-card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
}

.cm-list-tools{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:10px 0 14px 0;
}

.cm-list-tools-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.cm-list-tools-row > input{
  flex:1 1 320px;
}

.cm-check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  opacity:0.9;
}

.cm-check input{
  width:auto;
  margin:0;
}

#characterListView,
#characterEditorView,
#characterViewerView{
  min-height:100vh;
  overflow-y:auto;
  box-sizing:border-box;
  padding-bottom:32px;
}

.character-editor-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.character-maker-block{
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
}

.character-maker-label{
  font-weight:700;
  margin-bottom:8px;
}

.character-maker-row-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.character-maker-stats{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.character-maker-stat-row{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:8px;
  align-items:center;
}

.character-maker-validation{
  min-height:72px;
  padding:10px 12px;
  border-radius:10px;
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.10);
  white-space:pre-wrap;
}

.character-maker-validation.ok{
  border-color:rgba(76,175,80,0.55);
}

.character-maker-validation.error{
  border-color:rgba(184,74,74,0.70);
}

.character-maker-json{
  min-height:360px;
  font-family:Consolas, Monaco, monospace;
  white-space:pre;
}

.cm-sheet-layout{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:12px;
  align-items:start;
}

.cm-side-tabs{
  display:flex;
  flex-direction:column;
  gap:8px;
  position:sticky;
  top:12px;
}

.cm-side-tab{
  width:100%;
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.05);
  color:#fff;
}

.cm-side-tab:hover{
  background:rgba(255,255,255,0.08);
}

.cm-side-tab.active{
  outline:2px solid rgba(255,255,255,0.45);
  background:rgba(255,255,255,0.10);
}

.cm-side-tab-add{
  margin-top:4px;
}

.cm-sheet-main{
  min-width:0;
}

.cm-basic-top{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:14px;
  align-items:start;
}

.cm-image-box{
  min-width:0;
}

.cm-image-preview-wrap{
  width:100%;
  aspect-ratio:1 / 1;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(0,0,0,0.22);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.cm-image-preview{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.cm-image-empty{
  font-size:13px;
  opacity:0.75;
}

.cm-form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.cm-field-label{
  font-size:13px;
  font-weight:700;
  margin-bottom:6px;
}

.cm-fixed-status-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

.cm-status-card{
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-status-label{
  font-size:13px;
  font-weight:700;
  margin-bottom:6px;
}

.cm-status-input{
  width:100%;
}

.cm-basic-info-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.cm-basic-item{
  min-width:0;
}

.cm-basic-extra-item{
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-basic-extra-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}

.cm-basic-extra-label,
.cm-basic-extra-value{
  width:100%;
}

.cm-basic-extra-draft{
  margin-top:12px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.04);
}

.cm-basic-extra-display{
  display:flex;
  align-items:center;
  gap:8px;
}

.cm-basic-extra-check{
  width:18px;
  height:18px;
  accent-color:#d65a5a;
  flex:0 0 auto;
}

.cm-basic-extra-delete-bar{
  margin-top:10px;
}

.cm-pair-list{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.cm-pair-row{
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-pair-fields{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.cm-pair-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:8px;
}

.cm-pair-row .danger{
  grid-column:2;
  justify-self:end;
}

.cm-extra-tab-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
}

.cm-extra-tab-title{
  width:100%;
}

.cm-skill-subtabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:12px;
}

.cm-skill-subtab{
  width:auto;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.05);
  color:#fff;
}

.cm-skill-subtab.active{
  background:rgba(255,255,255,0.12);
  outline:2px solid rgba(255,255,255,0.35);
}

.cm-skill-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.cm-skill-row{
  display:grid;
  grid-template-columns:1fr 140px auto;
  gap:8px;
  align-items:center;
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-skill-row-fixed-label{
  font-weight:700;
  opacity:0.95;
}

.cm-skill-row-edit{
  grid-template-columns:1fr 140px;
}

.cm-skill-draft-box{
  margin-bottom:12px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.04);
}

.cm-skill-delete-mode-bar{
  margin-bottom:12px;
}

.cm-skill-point-summary{
  display:grid;
  grid-template-columns:repeat(2, minmax(220px, 1fr));
  gap:12px;
  margin:0 0 14px;
}

.cm-skill-point-card{
  border:1px solid rgba(255,255,255,0.16);
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  padding:10px 12px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  grid-template-areas:
    "label formula main"
    "sub sub sub";
  align-items:center;
  gap:4px 10px;
}

.cm-skill-point-card.is-over{
  border-color:rgba(255,120,120,0.5);
  background:rgba(255,120,120,0.08);
}

.cm-skill-point-label{
  grid-area:label;
  font-weight:700;
}

.cm-skill-point-formula{
  grid-area:formula;
  font-size:12px;
  opacity:0.78;
}

.cm-skill-point-main{
  grid-area:main;
  font-weight:800;
  font-size:22px;
  line-height:1;
  text-align:right;
}

.cm-skill-point-sub{
  grid-area:sub;
  font-size:12px;
  opacity:0.82;
}

.cm-skill-table{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-skill-table-row{
  display:grid;
  grid-template-columns:minmax(120px, 1.2fr) repeat(6, 56px);
  gap:4px;
  align-items:center;
}

.cm-skill-table-row input,
.cm-skill-total,
.cm-skill-fixed-label{
  padding-left:8px;
  padding-right:8px;
}

.cm-skill-table-head{
  font-weight:700;
  opacity:0.95;
  margin-bottom:2px;
}

.cm-skill-fixed-label{
  min-height:40px;
  display:flex;
  align-items:center;
  padding:0 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  font-weight:700;
}

.cm-skill-readonly{
  background:rgba(255,255,255,0.08);
}

.cm-skill-total{
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.08);
  font-weight:700;
}

.cm-skill-custom-actions{
  display:flex;
  justify-content:flex-end;
  margin:2px 0 8px;
}

.cm-skill-add-row{
  display:flex;
  justify-content:flex-end;
  margin-top:12px;
}

.cm-combat-section{
  margin-bottom:16px;
}

.cm-combat-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cm-combat-card{
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-combat-card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}

.cm-combat-name{
  flex:1 1 auto;
}

.cm-combat-skill-grid{
  display:grid;
  grid-template-columns:minmax(120px, 1.2fr) repeat(5, 56px);
  gap:4px;
  align-items:center;
  margin-bottom:10px;
}

.cm-combat-skill-grid-head{
  font-weight:700;
  opacity:0.95;
}

.cm-combat-total{
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 8px;
  border-radius:10px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.08);
  font-weight:700;
}

.cm-combat-readonly{
  background:rgba(255,255,255,0.08);
}

.cm-combat-meta-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

.cm-combat-meta-subgrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.cm-combat-derived-list{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}

.cm-combat-derived-card{
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-combat-derived-skill-grid{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:6px;
  margin-top:8px;
}

.cm-combat-resistance-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.cm-combat-resistance-row{
  display:grid;
  grid-template-columns:1fr 120px auto;
  gap:8px;
  align-items:center;
}

.cm-combat-tab-button{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.05);
  color:#fff;
  text-align:left;
}

.cm-combat-tab-button:hover{
  background:rgba(255,255,255,0.08);
}

.cm-combat-tab-title{
  font-weight:700;
  min-width:0;
  word-break:break-word;
}

.cm-combat-tab-icon{
  flex:0 0 auto;
  font-weight:700;
  opacity:0.9;
}

.cm-combat-card-detail{
  margin-top:10px;
}

.cm-combat-derived-table{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-combat-derived-row{
  display:grid;
  grid-template-columns:minmax(120px, 1.2fr) repeat(5, 56px);
  gap:4px;
  align-items:center;
}

.cm-combat-derived-head{
  font-weight:700;
  opacity:0.95;
}

.cm-combat-derived-label{
  min-height:40px;
  display:flex;
  align-items:center;
  padding:0 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  font-weight:700;
}

.cm-import-room-panel{
  position:fixed;
  z-index:100000;
  left:50%;
  top:88px;
  transform:translateX(-50%);
  width:min(720px, calc(100vw - 24px));
  max-height:min(78vh, 720px);
  overflow:auto;
  padding:0;
  margin:0;
}

.cm-import-room-panel.hidden{
  display:none !important;
}

.cm-import-room-card{
  width:100%;
  background:rgba(30,30,47,0.98);
  border:1px solid rgba(255,255,255,0.14);
  border-radius:14px;
  padding:18px;
  box-sizing:border-box;
  box-shadow:0 16px 40px rgba(0,0,0,0.42);
  color:#fff;
}

.cm-import-room-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

.cm-import-room-head h3{
  margin:0;
}

.cm-import-room-tools{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cm-import-room-tool-row{
  display:flex;
  gap:14px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.cm-import-room-panel .cm-field-label{
  margin-bottom:6px;
}

.cm-import-room-panel input[type="text"],
.cm-import-room-panel select{
  width:100%;
  min-height:40px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(0,0,0,0.22);
  color:#fff;
  font:inherit;
  outline:none;
  box-sizing:border-box;
}

.cm-import-room-panel input[type="text"]::placeholder{
  color:rgba(255,255,255,0.55);
}

.cm-import-room-panel .cm-check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  opacity:0.95;
}

.cm-import-room-panel .cm-check input{
  width:auto;
  min-height:auto;
  margin:0;
}

#cmImportRoomSelect{
  width:100%;
  min-height:180px;
  box-sizing:border-box;
  padding:8px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(0,0,0,0.22);
  color:#fff;
}

#cmImportRoomSelect option{
  background:#2c2c3f;
  color:#fff;
  padding:6px 8px;
}

#cmImportRoomMeta{
  margin-top:10px;
  font-size:12px;
  line-height:1.5;
  opacity:0.82;
  white-space:pre-wrap;
}

@media (max-width: 980px){
  .cm-card{
    flex-direction:column;
    align-items:flex-start;
  }

  .cm-card-actions{
    width:100%;
    justify-content:flex-start;
  }

  .character-maker-stat-row{
    grid-template-columns:1fr;
  }

  .cm-sheet-layout{
    grid-template-columns:1fr;
  }

  .cm-side-tabs{
    position:static;
    flex-direction:row;
    flex-wrap:wrap;
  }

  .cm-side-tab{
    width:auto;
  }

  .cm-basic-top{
    grid-template-columns:1fr;
  }

  .cm-form-grid{
    grid-template-columns:1fr;
  }

  .cm-fixed-status-grid{
    grid-template-columns:1fr;
  }

  .cm-basic-info-grid{
    grid-template-columns:1fr;
  }

  .cm-pair-list{
    grid-template-columns:1fr;
  }

  .cm-pair-fields{
    grid-template-columns:1fr;
  }

  .cm-pair-row .danger{
    grid-column:auto;
    justify-self:start;
  }

  .cm-skill-row{
    grid-template-columns:1fr;
  }

  .cm-skill-row-edit{
    grid-template-columns:1fr;
  }

  .cm-skill-table-row{
    grid-template-columns:1fr;
  }

  .cm-skill-table-head{
    display:none;
  }

  .cm-combat-skill-grid{
    grid-template-columns:1fr;
  }

  .cm-combat-skill-grid-head{
    display:none;
  }

  .cm-combat-meta-grid{
    grid-template-columns:1fr;
  }

  .cm-combat-meta-subgrid{
    grid-template-columns:1fr;
  }

  .cm-combat-derived-list{
    grid-template-columns:1fr;
  }

  .cm-combat-derived-skill-grid{
    grid-template-columns:1fr;
  }

  .cm-combat-resistance-row{
    grid-template-columns:1fr;
  }

  .cm-combat-derived-row{
    grid-template-columns:1fr;
  }

  .cm-combat-derived-head{
    display:none;
  }
}

@media (max-width: 720px){
  .cm-import-room-panel{
    top:72px;
    width:calc(100vw - 16px);
  }

  .cm-import-room-tool-row{
    flex-direction:column;
    align-items:stretch;
  }
}

.cm-viewer-body{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.cm-viewer-hero{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:14px;
  align-items:start;
}

.cm-viewer-image{
  width:100%;
  aspect-ratio:1 / 1;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(0,0,0,0.22);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.cm-viewer-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.cm-viewer-image-empty{
  font-size:13px;
  opacity:0.75;
}

.cm-viewer-summary{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cm-viewer-name{
  font-size:28px;
  font-weight:800;
  line-height:1.2;
}

.cm-viewer-ruby{
  font-size:14px;
  opacity:0.78;
}

.cm-viewer-section{
  padding:14px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-section h2{
  margin:0 0 10px 0;
  font-size:18px;
}

.cm-viewer-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.cm-viewer-kv{
  padding:10px;
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-kv-label{
  font-size:12px;
  opacity:0.72;
  margin-bottom:4px;
}

.cm-viewer-kv-value{
  font-size:14px;
  font-weight:700;
  word-break:break-word;
}

.cm-viewer-status-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

.cm-viewer-skill-groups{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cm-viewer-skill-group{
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-skill-group h3{
  margin:0 0 10px 0;
  font-size:15px;
}

.cm-viewer-skill-table{
  display:grid;
  grid-template-columns:minmax(120px, 1.2fr) 72px;
  gap:6px;
}

.cm-viewer-skill-row{
  display:contents;
}

.cm-viewer-skill-cell{
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-skill-cell.is-value{
  text-align:center;
  font-weight:700;
}

.cm-viewer-combat-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.cm-viewer-combat-card{
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-combat-name{
  font-size:16px;
  font-weight:700;
  margin-bottom:8px;
}

.cm-viewer-combat-meta{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.cm-viewer-text{
  white-space:pre-wrap;
  word-break:break-word;
  line-height:1.7;
}

.cm-viewer-empty{
  opacity:0.72;
}

@media (max-width: 980px){
  .cm-viewer-hero{
    grid-template-columns:1fr;
  }

  .cm-viewer-grid,
  .cm-viewer-status-grid,
  .cm-viewer-combat-meta{
    grid-template-columns:1fr;
  }

  .cm-viewer-skill-table{
    grid-template-columns:1fr;
  }
}

.cm-viewer-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0;
  margin:0;
  border:none;
  background:transparent;
  color:#fff;
  text-align:left;
  cursor:pointer;
}

.cm-viewer-toggle h2{
  margin:0;
  font-size:18px;
}

.cm-viewer-toggle-icon{
  flex:0 0 auto;
  font-size:14px;
  opacity:0.82;
}

.cm-viewer-collapsible-body{
  margin-top:12px;
}

.cm-viewer-collapsible-body.is-collapsed{
  display:none;
}

.cm-viewer-skill-detail-group{
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-skill-detail-group + .cm-viewer-skill-detail-group{
  margin-top:12px;
}

.cm-viewer-skill-detail-group h3{
  margin:0 0 10px 0;
  font-size:15px;
}

.cm-viewer-skill-detail-table{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-viewer-skill-detail-head,
.cm-viewer-skill-detail-row{
  display:grid;
  grid-template-columns:minmax(120px, 1.6fr) repeat(6, minmax(54px, 1fr));
  gap:6px;
  align-items:center;
}

.cm-viewer-skill-detail-head{
  font-size:12px;
  opacity:0.78;
  font-weight:700;
}

.cm-viewer-skill-detail-cell{
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
  word-break:break-word;
}

.cm-viewer-skill-detail-cell.is-num{
  text-align:center;
  font-weight:700;
}

@media (max-width: 980px){
  .cm-viewer-skill-detail-head{
    display:none;
  }

  .cm-viewer-skill-detail-row{
    grid-template-columns:1fr;
  }

  .cm-viewer-skill-detail-cell.is-num{
    text-align:left;
  }
}

#characterViewerView{
  overflow-y:auto;
}

.cm-viewer-body{
  padding-bottom:24px;
}

/* ===== Viewer / shared character page ===== */

#characterViewerView{
  min-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding-bottom: 32px;
}

.cm-viewer-body{
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
}

.cm-viewer-hero{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: start;
}

.cm-viewer-image{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cm-viewer-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cm-viewer-image-empty{
  font-size: 13px;
  opacity: 0.75;
}

.cm-viewer-summary{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cm-viewer-name{
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.cm-viewer-ruby{
  font-size: 14px;
  opacity: 0.78;
}

.cm-viewer-section{
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.cm-viewer-section h2{
  margin: 0 0 10px 0;
  font-size: 18px;
}

.cm-viewer-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cm-viewer-kv{
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.cm-viewer-kv-label{
  font-size: 12px;
  opacity: 0.72;
  margin-bottom: 4px;
}

.cm-viewer-kv-value{
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.cm-viewer-status-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cm-viewer-text{
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.cm-viewer-empty{
  opacity: 0.72;
}

/* 折り畳み */
.cm-viewer-toggle{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.cm-viewer-toggle h2{
  margin: 0;
  font-size: 18px;
}

.cm-viewer-toggle-icon{
  flex: 0 0 auto;
  font-size: 14px;
  opacity: 0.82;
}

.cm-viewer-collapsible-body{
  margin-top: 12px;
}

.cm-viewer-collapsible-body.is-collapsed{
  display: none;
}

/* 技能詳細テーブル */
.cm-viewer-skill-groups{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cm-viewer-skill-detail-group{
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.cm-viewer-skill-detail-group + .cm-viewer-skill-detail-group{
  margin-top: 12px;
}

.cm-viewer-skill-detail-group h3{
  margin: 0 0 10px 0;
  font-size: 15px;
}

.cm-viewer-skill-detail-table{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cm-viewer-skill-detail-head,
.cm-viewer-skill-detail-row{
  display: grid;
  grid-template-columns: minmax(120px, 1.6fr) repeat(6, minmax(54px, 1fr));
  gap: 6px;
  align-items: center;
}

.cm-viewer-skill-detail-head{
  font-size: 12px;
  opacity: 0.78;
  font-weight: 700;
}

.cm-viewer-skill-detail-cell{
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  word-break: break-word;
}

.cm-viewer-skill-detail-cell.is-num{
  text-align: center;
  font-weight: 700;
}

/* 戦闘 */
.cm-viewer-combat-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cm-viewer-combat-card{
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.cm-viewer-combat-name{
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cm-viewer-combat-meta{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 980px){
  .cm-viewer-hero{
    grid-template-columns: 1fr;
  }

  .cm-viewer-grid,
  .cm-viewer-status-grid,
  .cm-viewer-combat-meta{
    grid-template-columns: 1fr;
  }

  .cm-viewer-skill-detail-head{
    display: none;
  }

  .cm-viewer-skill-detail-row{
    grid-template-columns: 1fr;
  }

  .cm-viewer-skill-detail-cell.is-num{
    text-align: left;
  }
}

.cm-viewer-toggle,
.cm-viewer-toggle:focus,
.cm-viewer-toggle:active,
.cm-viewer-toggle:hover{
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
}

.cm-viewer-toggle h2{
  color: #fff !important;
}

.cm-viewer-toggle-icon{
  color: rgba(255,255,255,0.82) !important;
}

#characterViewerView .cm-viewer-toggle,
#characterViewerView .cm-viewer-toggle:hover,
#characterViewerView .cm-viewer-toggle:focus,
#characterViewerView .cm-viewer-toggle:focus-visible,
#characterViewerView .cm-viewer-toggle:active{
  background: transparent !important;
  background-image: none !important;
  color: #fff !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  filter: none !important;
  -webkit-tap-highlight-color: transparent;
}

#characterViewerView .cm-viewer-toggle h2{
  color: #fff !important;
}

#characterViewerView .cm-viewer-toggle-icon{
  color: rgba(255,255,255,0.82) !important;
}



.cm-status-row{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:8px;
}

.cm-status-row.cm-status-row-derived{
  grid-template-columns:repeat(5, minmax(0, 1fr));
}

.cm-status-col-label{
  font-size:12px;
  opacity:0.75;
  margin-bottom:4px;
}

.cm-status-total{
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.08);
  font-weight:700;
}

.cm-status-readonly{
  background:rgba(255,255,255,0.08);
}

@media (max-width: 980px){
  .cm-status-row,
  .cm-status-row.cm-status-row-derived{
    grid-template-columns:1fr;
  }
}

.cm-status-table{
  display:flex;
  flex-direction:column;
  gap:0;
  border-top:1px solid rgba(255,255,255,0.14);
  border-left:1px solid rgba(255,255,255,0.14);
  background:transparent;
  width:100%;
}

.cm-status-table-head,
.cm-status-table-row{
  display:grid;
  grid-template-columns:110px repeat(9, minmax(0, 1fr));
  gap:0;
  align-items:stretch;
}

#cmDerivedStatusList .cm-status-table-head,
#cmDerivedStatusList .cm-status-table-row{
  grid-template-columns:110px repeat(6, minmax(0, 1fr));
}

.cm-status-table-head > div,
.cm-status-table-row > div,
.cm-status-table-label,
.cm-status-table-total{
  border-right:1px solid rgba(255,255,255,0.14);
  border-bottom:1px solid rgba(255,255,255,0.14);
  border-radius:0 !important;
}

.cm-status-table-head{
  font-weight:700;
  opacity:0.95;
  font-size:12px;
}

.cm-status-table-head > div{
  min-height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:4px 2px;
  background:rgba(255,255,255,0.02);
  white-space:nowrap;
  font-size:12px;
}

.cm-status-table-label{
  min-height:38px;
  display:flex;
  align-items:center;
  padding:0 8px;
  background:rgba(255,255,255,0.02);
  font-weight:700;
  white-space:nowrap;
}

.cm-status-table-input{
  width:100%;
  min-height:38px;
  box-sizing:border-box;
  text-align:center;
  padding:4px 2px;
  border:none !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:#fff;
  font:inherit;
}

.cm-status-table-input:focus{
  outline:1px solid rgba(255,255,255,0.35);
  outline-offset:-1px;
}

.cm-status-table-total{
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 4px;
  background:rgba(255,255,255,0.04);
  font-weight:700;
}

.cm-status-readonly{
  background:rgba(255,255,255,0.06);
}

@media (max-width: 980px){
  .cm-status-table-head,
  .cm-status-table-row{
    grid-template-columns:88px repeat(9, minmax(0, 1fr));
  }

  #cmDerivedStatusList .cm-status-table-head,
  #cmDerivedStatusList .cm-status-table-row{
    grid-template-columns:88px repeat(6, minmax(0, 1fr));
  }

  .cm-status-table-head > div{
    font-size:11px;
    padding:4px 1px;
  }

  .cm-status-table-label{
    padding:0 6px;
    font-size:12px;
  }

  .cm-status-table-input,
  .cm-status-table-total{
    font-size:12px;
  }
}

.cm-status-table-stack{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cm-status-table{
  width:100%;
}

.cm-status-table-head,
.cm-status-table-row{
  width:100%;
}

.cm-status-table-head > div,
.cm-status-table-row > div{
  min-width:0;
}

.cm-status-table-input,
.cm-status-table-total{
  font-size:14px;
}

@media (max-width: 980px){
  .cm-status-table-head,
  .cm-status-table-row{
    font-size:12px;
  }

  .cm-status-table-head > div{
    font-size:11px;
  }

  .cm-status-table-input,
  .cm-status-table-total{
    font-size:12px;
  }
}

.cm-status-table-stack{
  display:flex;
  flex-direction:column;
  gap:14px;
  width:100%;
}

.cm-status-table{
  width:100%;
  overflow:visible;
}





.cm-status-table-head > div{
  font-size:13px;
}



@media (max-width: 980px){
  .cm-status-table-head > div{
    font-size:12px;
  }

  .cm-status-table-input,
  .cm-status-table-total{
    font-size:13px;
  }
}

#cmFixedStatusList,
#cmDerivedStatusList{
  width: 100%;
}

.cm-status-table-stack{
  width: 100%;
}

.cm-status-table{
  width: 100%;
}

.cm-status-table-head > div,
.cm-status-table-row > div{
  overflow: hidden;
}

.cm-status-table-head > div{
  justify-content: center;
  text-align: center;
}







.cm-status-table-head > div{
  font-size:12px;
  padding:4px 2px;
  text-align:center;
  justify-content:center;
  white-space:nowrap;
}

.cm-status-table-label{
  white-space:nowrap;
}



.cm-status-table-input{
  text-align:center;
  padding:4px 2px;
}

@media (max-width: 980px){
  .cm-status-table-head > div{
    font-size:11px;
  }

  .cm-status-table-input,
  .cm-status-table-total{
    font-size:13px;
  }
}

/* ===== 技能タブを表っぽくする ===== */

.cm-skill-table{
  display:flex;
  flex-direction:column;
  gap:0;
  border-top:1px solid rgba(255,255,255,0.14);
  border-left:1px solid rgba(255,255,255,0.14);
  background:transparent;
}

.cm-skill-table-row{
  display:grid;
  grid-template-columns:minmax(180px, 1.8fr) repeat(6, minmax(56px, 1fr));
  gap:0;
  align-items:stretch;
}

.cm-skill-table-row > div,
.cm-skill-fixed-label,
.cm-skill-total,
.cm-skill-table-row input{
  border-right:1px solid rgba(255,255,255,0.14);
  border-bottom:1px solid rgba(255,255,255,0.14);
  border-radius:0 !important;
  box-shadow:none !important;
}

.cm-skill-table-head{
  font-weight:700;
  opacity:0.95;
}

.cm-skill-table-head > div{
  min-height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:4px 2px;
  background:rgba(255,255,255,0.02);
  font-size:12px;
  white-space:nowrap;
}

.cm-skill-fixed-label{
  min-height:40px;
  display:flex;
  align-items:center;
  padding:0 10px;
  background:rgba(255,255,255,0.02);
  font-weight:700;
}

.cm-skill-table-row input{
  width:100%;
  min-height:40px;
  box-sizing:border-box;
  text-align:center;
  padding:4px 2px;
  border:none !important;
  background:transparent !important;
  color:#fff;
  font:inherit;
}

.cm-skill-table-row input:focus{
  outline:1px solid rgba(255,255,255,0.35);
  outline-offset:-1px;
}

.cm-skill-total{
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  background:rgba(255,255,255,0.04);
  font-weight:700;
}

/* ===== 戦闘技能タブも表っぽくする ===== */

.cm-combat-skill-grid,
.cm-combat-derived-row{
  gap:0 !important;
}

.cm-combat-skill-grid > div,
.cm-combat-derived-row > div,
.cm-combat-total,
.cm-combat-derived-label,
.cm-combat-skill-grid input,
.cm-combat-derived-row input{
  border-right:1px solid rgba(255,255,255,0.14);
  border-bottom:1px solid rgba(255,255,255,0.14);
  border-radius:0 !important;
  box-shadow:none !important;
}

.cm-combat-skill-grid{
  border-top:1px solid rgba(255,255,255,0.14);
  border-left:1px solid rgba(255,255,255,0.14);
}

.cm-combat-skill-grid-head{
  font-size:12px;
  opacity:0.95;
  font-weight:700;
}

.cm-combat-skill-grid-head > div{
  min-height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:4px 2px;
  background:rgba(255,255,255,0.02);
  white-space:nowrap;
}

.cm-combat-skill-grid input,
.cm-combat-derived-row input{
  width:100%;
  min-height:40px;
  box-sizing:border-box;
  text-align:center;
  padding:4px 2px;
  border:none !important;
  background:transparent !important;
  color:#fff;
  font:inherit;
}

.cm-combat-skill-grid input:focus,
.cm-combat-derived-row input:focus{
  outline:1px solid rgba(255,255,255,0.35);
  outline-offset:-1px;
}

.cm-combat-total,
.cm-combat-derived-label{
  min-height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  background:rgba(255,255,255,0.04);
  font-weight:700;
}

@media (max-width: 980px){
  .cm-skill-table-row{
    grid-template-columns:minmax(120px, 1.6fr) repeat(6, minmax(44px, 1fr));
  }

  .cm-skill-table-head > div,
  .cm-combat-skill-grid-head > div{
    font-size:11px;
  }

  .cm-skill-table-row input,
  .cm-skill-total,
  .cm-combat-skill-grid input,
  .cm-combat-total{
    font-size:12px;
  }
}

@media (max-width: 760px){
  .cm-skill-point-summary{
    grid-template-columns:1fr;
  }

  .cm-skill-point-card{
    grid-template-columns:1fr auto;
    grid-template-areas:
      "label main"
      "formula main"
      "sub sub";
  }
}

.cm-combat-meta-grid input,
.cm-combat-meta-grid select{
  width:100%;
  min-height:40px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(0,0,0,0.22);
  color:#fff;
  font:inherit;
  outline:none;
  box-sizing:border-box;
}

.cm-combat-meta-grid select option{
  background:#2c2c3f;
  color:#fff;
}

.cm-combat-required-empty{
  border-color:rgba(255,120,120,0.85) !important;
  box-shadow:0 0 0 1px rgba(255,120,120,0.22);
}

.cm-viewer-status-block + .cm-viewer-status-block{
  margin-top:14px;
}

.cm-viewer-status-block h3{
  margin:0 0 10px 0;
  font-size:15px;
}

.cm-viewer-status-detail-table{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-viewer-status-detail-head,
.cm-viewer-status-detail-row{
  display:grid;
  grid-template-columns:minmax(100px, 1.2fr) repeat(4, 72px);
  gap:6px;
  align-items:center;
}

.cm-viewer-status-detail-head{
  font-weight:700;
  opacity:0.95;
}

.cm-viewer-status-detail-cell{
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-status-detail-cell.is-num{
  text-align:center;
  font-weight:700;
}

.cm-viewer-skill-point-summary{
  display:grid;
  grid-template-columns:repeat(2, minmax(220px, 1fr));
  gap:12px;
  margin:0 0 14px;
}

.cm-viewer-skill-point-card{
  border:1px solid rgba(255,255,255,0.16);
  border-radius:10px;
  background:rgba(255,255,255,0.04);
  padding:10px 12px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  grid-template-areas:
    "label formula main"
    "sub sub sub";
  align-items:center;
  gap:4px 10px;
}

.cm-viewer-skill-point-card.is-over{
  border-color:rgba(255,120,120,0.5);
  background:rgba(255,120,120,0.08);
}

.cm-viewer-skill-point-label{
  grid-area:label;
  font-weight:700;
}

.cm-viewer-skill-point-formula{
  grid-area:formula;
  font-size:12px;
  opacity:0.78;
}

.cm-viewer-skill-point-main{
  grid-area:main;
  font-weight:800;
  font-size:22px;
  line-height:1;
  text-align:right;
}

.cm-viewer-skill-point-sub{
  grid-area:sub;
  font-size:12px;
  opacity:0.82;
}

@media (max-width: 980px){
  .cm-viewer-status-detail-head{
    display:none;
  }

  .cm-viewer-status-detail-row{
    grid-template-columns:1fr;
  }

  .cm-viewer-status-detail-cell.is-num{
    text-align:left;
  }

  .cm-viewer-skill-point-summary{
    grid-template-columns:1fr;
  }
}

/* ===== 閲覧画面：ステータスを横並び表にする ===== */

.cm-viewer-status-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.cm-viewer-status-group h3{
  margin:0 0 10px;
  font-size:16px;
  font-weight:700;
}

.cm-viewer-status-table-wrap{
  display:flex;
  flex-direction:column;
  gap:0;
  border-top:1px solid rgba(255,255,255,0.14);
  border-left:1px solid rgba(255,255,255,0.14);
  background:transparent;
}

.cm-viewer-status-table-head,
.cm-viewer-status-table-row{
  display:grid;
  grid-template-columns:180px repeat(4, minmax(64px, 1fr));
  gap:0;
}

.cm-viewer-status-table-head > div,
.cm-viewer-status-table-row > div{
  min-width:0;
  padding:10px 8px;
  border-right:1px solid rgba(255,255,255,0.14);
  border-bottom:1px solid rgba(255,255,255,0.14);
  text-align:center;
  background:rgba(255,255,255,0.03);
}

.cm-viewer-status-table-head > div{
  font-size:13px;
  font-weight:700;
  background:rgba(255,255,255,0.06);
  white-space:nowrap;
}

.cm-viewer-status-table-label{
  text-align:left !important;
  font-weight:700;
  white-space:nowrap;
}

.cm-viewer-status-table-total{
  font-weight:800;
  color:#fff;
}

/* ===== 閲覧画面：技能を穴ぼこではなく表にする ===== */

.cm-viewer-skill-groups{
  display:flex;
  flex-direction:column;
  gap:24px;
}

.cm-viewer-skill-table-group h3{
  margin:0 0 10px;
  font-size:16px;
  font-weight:700;
}

.cm-viewer-skill-table{
  display:flex;
  flex-direction:column;
  gap:0;
  border-top:1px solid rgba(255,255,255,0.14);
  border-left:1px solid rgba(255,255,255,0.14);
  background:transparent;
}

.cm-viewer-skill-table-head,
.cm-viewer-skill-table-row{
  display:grid;
  grid-template-columns:180px repeat(6, minmax(64px, 1fr));
  gap:0;
}

.cm-viewer-skill-table-head > div,
.cm-viewer-skill-table-row > div{
  min-width:0;
  padding:10px 8px;
  border-right:1px solid rgba(255,255,255,0.14);
  border-bottom:1px solid rgba(255,255,255,0.14);
  text-align:center;
  background:rgba(255,255,255,0.03);
}

.cm-viewer-skill-table-head > div{
  font-size:13px;
  font-weight:700;
  background:rgba(255,255,255,0.06);
  white-space:nowrap;
}

.cm-viewer-skill-table-name{
  text-align:left !important;
  font-weight:700;
  white-space:nowrap;
}

.cm-viewer-skill-table-total{
  font-weight:800;
  color:#fff;
}

@media (max-width: 980px){
  .cm-viewer-status-table-head,
  .cm-viewer-status-table-row{
    grid-template-columns:120px repeat(4, minmax(50px, 1fr));
  }

  .cm-viewer-skill-table-head,
  .cm-viewer-skill-table-row{
    grid-template-columns:120px repeat(6, minmax(50px, 1fr));
  }

  .cm-viewer-status-table-head > div,
  .cm-viewer-status-table-row > div,
  .cm-viewer-skill-table-head > div,
  .cm-viewer-skill-table-row > div{
    padding:8px 4px;
    font-size:12px;
  }
}

.cm-collection-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.cm-collection-card{
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
  border-radius:14px;
  padding:14px;
}

.cm-collection-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.cm-collection-card-title{
  font-size:15px;
  font-weight:700;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.cm-collection-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.cm-collection-span-full{
  grid-column:1 / -1;
}

.cm-collection-money-box{
  margin-top:14px;
}

.cm-collection-empty{
  padding:14px;
  border:1px dashed rgba(255,255,255,0.16);
  border-radius:12px;
  background:rgba(255,255,255,0.03);
  opacity:0.88;
}

.cm-viewer-collection-table{
  display:flex;
  flex-direction:column;
  gap:0;
  border-top:1px solid rgba(255,255,255,0.14);
  border-left:1px solid rgba(255,255,255,0.14);
}

.cm-viewer-collection-head,
.cm-viewer-collection-row{
  display:grid;
  gap:0;
}

.cm-viewer-collection-head.is-belongings,
.cm-viewer-collection-row.is-belongings{
  grid-template-columns:180px 90px minmax(0, 1fr);
}

.cm-viewer-collection-head > div,
.cm-viewer-collection-row > div{
  min-width:0;
  padding:10px 8px;
  border-right:1px solid rgba(255,255,255,0.14);
  border-bottom:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.03);
}

.cm-viewer-collection-head > div{
  font-size:13px;
  font-weight:700;
  background:rgba(255,255,255,0.06);
}

.cm-viewer-money-box{
  margin-top:14px;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  padding:12px 14px;
}

.cm-viewer-money-label{
  font-size:12px;
  opacity:0.78;
  margin-bottom:4px;
}

.cm-viewer-money-value{
  font-size:16px;
  font-weight:700;
  word-break:break-word;
}

.cm-viewer-scenario-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.cm-viewer-scenario-card{
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  overflow:hidden;
}

.cm-viewer-scenario-summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
}

.cm-viewer-scenario-summary::-webkit-details-marker{
  display:none;
}

.cm-viewer-scenario-title{
  font-weight:700;
}

.cm-viewer-scenario-hint{
  font-size:12px;
  opacity:0.72;
  white-space:nowrap;
}

.cm-viewer-scenario-body{
  padding:0 14px 14px;
  white-space:pre-wrap;
  word-break:break-word;
  border-top:1px solid rgba(255,255,255,0.10);
  margin-top:2px;
  padding-top:12px;
}

@media (max-width: 980px){
  .cm-collection-grid{
    grid-template-columns:1fr;
  }

  .cm-viewer-collection-head.is-belongings,
  .cm-viewer-collection-row.is-belongings{
    grid-template-columns:120px 72px minmax(0, 1fr);
  }

  .cm-viewer-scenario-summary{
    flex-direction:column;
    align-items:flex-start;
  }
}

.cm-publish-state{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.06);
}

.cm-publish-state.is-public{
  color:#dff6df;
  border-color:rgba(90, 200, 120, 0.45);
  background:rgba(90, 200, 120, 0.14);
}

.cm-publish-state.is-private{
  color:#f3dede;
  border-color:rgba(210, 120, 120, 0.45);
  background:rgba(210, 120, 120, 0.12);
}

.cm-extra-tab-mode-box{
  margin:12px 0;
}

.cm-extra-tab-mode{
  width:100%;
  min-height:40px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(0,0,0,0.22);
  color:#fff;
  font:inherit;
  outline:none;
  box-sizing:border-box;
}

.cm-extra-tab-mode option{
  background:#2c2c3f;
  color:#fff;
}

.cm-viewer-extra-spoiler{
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  overflow:hidden;
}

.cm-viewer-extra-spoiler-summary{
  list-style:none;
  cursor:pointer;
  padding:12px 14px;
  font-weight:700;
}

.cm-viewer-extra-spoiler-summary::-webkit-details-marker{
  display:none;
}

.cm-viewer-extra-spoiler .cm-viewer-text{
  border-top:1px solid rgba(255,255,255,0.10);
  padding-top:12px;
}

/* merged fix: viewer current-status layout */
.cm-viewer-status-current-grid{
  display:grid;
  grid-template-columns:repeat(8, minmax(0, 1fr));
  gap:14px 16px;
  align-items:end;
}

.cm-viewer-status-current-card{
  min-width:0;
  padding:8px 0 10px;
  border-bottom:1px solid rgba(255,255,255,0.45);
}

.cm-viewer-status-current-label{
  font-size:12px;
  font-weight:700;
  margin-bottom:6px;
  opacity:0.95;
  white-space:nowrap;
}

.cm-viewer-status-current-value{
  font-size:18px;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
}

@media (max-width: 1200px){
  .cm-viewer-status-current-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px){
  .cm-viewer-status-current-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

.cm-combat-subtabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:14px 0 12px;
}

.cm-combat-subtab{
  width:auto;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.05);
  color:#fff;
  font:inherit;
}

.cm-combat-subtab.active{
  background:rgba(255,255,255,0.12);
  outline:2px solid rgba(255,255,255,0.22);
}

.cm-combat-subpanel{
  margin-top:4px;
}

.cm-combat-detail-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.cm-combat-detail-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.cm-combat-detail-field input,
.cm-combat-detail-field select{
  width:100%;
  min-height:40px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(0,0,0,0.22);
  color:#fff;
  font:inherit;
  outline:none;
  box-sizing:border-box;
}

.cm-combat-detail-field select option{
  background:#2c2c3f;
  color:#fff;
}

.cm-combat-area-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.cm-combat-static-note{
  min-height:40px;
  display:flex;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
  font-weight:700;
}

.cm-combat-formula-note{
  margin-bottom:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
  font-size:13px;
  line-height:1.5;
  opacity:0.95;
}

.cm-combat-check-field{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
}

.cm-combat-check-row{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  cursor:pointer;
}

.cm-combat-check-row input{
  width:18px;
  height:18px;
}

.cm-combat-check-note{
  margin-top:6px;
  font-size:12px;
  opacity:0.75;
  line-height:1.5;
}

@media (max-width: 980px){
  .cm-combat-detail-grid{
    grid-template-columns:1fr;
  }
}

.cm-combat-expected-box{
  margin-top:14px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
}

.cm-combat-expected-title{
  font-weight:700;
  margin-bottom:10px;
}

.cm-combat-expected-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.cm-combat-expected-item{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-combat-expected-item.is-main{
  background:rgba(255,255,255,0.08);
}

.cm-combat-expected-label{
  font-size:12px;
  opacity:0.8;
  margin-bottom:6px;
}

.cm-combat-expected-value{
  font-size:20px;
  font-weight:700;
  line-height:1.2;
}

@media (max-width: 980px){
  .cm-combat-expected-grid{
    grid-template-columns:1fr;
  }
}

.cm-viewer-combat-expected-box{
  margin-top:12px;
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.10);
}

.cm-viewer-combat-expected-title{
  font-size:14px;
  font-weight:700;
  margin-bottom:10px;
}

.cm-viewer-combat-expected-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

.cm-viewer-combat-expected-item{
  padding:10px 12px;
  border-radius:10px;
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-combat-expected-item.is-main{
  background:rgba(255,255,255,0.08);
}

.cm-viewer-combat-expected-label{
  font-size:12px;
  opacity:0.8;
  margin-bottom:6px;
}

.cm-viewer-combat-expected-value{
  font-size:18px;
  font-weight:800;
  line-height:1.2;
  word-break:break-word;
}

@media (max-width: 980px){
  .cm-viewer-combat-expected-grid{
    grid-template-columns:1fr;
  }
}

.cm-viewer-combat-card{
  padding:0;
  overflow:hidden;
}

.cm-viewer-combat-summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
}

.cm-viewer-combat-summary::-webkit-details-marker{
  display:none;
}

.cm-viewer-combat-summary-sub{
  font-size:12px;
  opacity:0.72;
  white-space:nowrap;
}

.cm-viewer-combat-body{
  padding:0 14px 14px;
  border-top:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-combat-flow-box{
  margin-top:12px;
  padding:12px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.10);
}

.cm-viewer-combat-flow-title{
  font-size:14px;
  font-weight:700;
  margin-bottom:10px;
}

.cm-viewer-combat-flow-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.cm-viewer-combat-flow-item{
  padding:10px 12px;
  border-radius:10px;
  background:rgba(0,0,0,0.18);
  border:1px solid rgba(255,255,255,0.08);
}

.cm-viewer-combat-flow-label{
  font-size:12px;
  opacity:0.8;
  margin-bottom:6px;
}

.cm-viewer-combat-flow-value{
  font-size:14px;
  font-weight:700;
  line-height:1.4;
  word-break:break-word;
}

@media (max-width: 980px){
  .cm-viewer-combat-flow-grid{
    grid-template-columns:1fr;
  }

  .cm-viewer-combat-summary{
    flex-direction:column;
    align-items:flex-start;
  }

  .cm-viewer-combat-summary-sub{
    white-space:normal;
  }
}