.param-bulk-label-row {
  display: flex;
  align-items: center;
  margin-bottom: 0px;
}
.param-bulk-roll-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 0px;
}
.param-bulk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0px;
}
.param-bulk-label {
  font-weight: bold;
  font-size: 15px;
  margin-right: 12px;
}
#paramBulkDiceSelect.left-align {
  margin-right: 0;
}
.param-bulk-roll-inner.left-align {
  justify-content: flex-end;
  justify-content: flex-start;
}
.bulk-center-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 48px;
  text-align: center;
  padding: 0 8px;
}
:root{
  --ui-w:320px;
  --gap:16px;
  --bg:#f7f7f7;
  --muted:#6b6b6b;
  --accent:#0b74de;
}

*{box-sizing:border-box;}

html,body{height:100%;}
body{
  margin:0;
  padding-top: var(--header-offset, 80px);
  font-family:"Noto Sans JP",system-ui,Roboto,Arial;
  background:#f5f5f5;
  color:#222;
}

.header-container{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  z-index: 1000;
  padding: 18px 18px 8px;
}

.header-top{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
}

.header-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}

h3{
  margin:0 0 12px 0;
  font-size:18px;
  flex:1;
}

.home-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:50%;
  background:#f0f0f0;
  border:1px solid #ddd;
  text-decoration:none;
  transition:all 0.2s ease;
  box-shadow:0 2px 4px rgba(0,0,0,0.05);
}

.home-btn:hover{
  background:#e8e8e8;
  transform:translateY(-1px);
  box-shadow:0 4px 8px rgba(0,0,0,0.1);
}

.home-icon{font-size:20px;line-height:1;}

.header-action-btn{
  height:36px;
  padding:0 12px;
  border-radius:18px;
  border:1px solid #ddd;
  background:#f0f0f0;
  color:#222;
  font-size:12px;
  cursor:pointer;
  transition:all 0.2s ease;
  white-space:nowrap;
  flex-shrink:0;
}

.header-action-btn:hover{
  background:#e8e8e8;
  transform:translateY(-1px);
  box-shadow:0 4px 8px rgba(0,0,0,0.1);
}

#resetBtn{
  margin-right:60px;
}

.header-action-btn.btnPrimary{
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
}

.header-action-btn.btnPrimary:hover{
  filter:brightness(1.1);
}

.container{
  display:flex;
  gap:var(--gap);
  align-items:flex-start;
  min-height:calc(100vh - 36px);
  padding:0 16px 18px;
  max-width:1000px;
  margin:0 auto;
}

.panel{
  background:#fff;
  border-radius:10px;
  padding:12px;
  border:2px solid #eee;
}

.form-panel{
  flex:1;
  min-width:280px;
}

.right-column{
  display:flex;
  flex-direction:column;
  gap:16px;
  width:var(--ui-w);
}

.output-panel{
  width:100%;
  height:250px;
  overflow:auto;
}

.auto-calc-panel{
  width:100%;
}

.panel > strong{
  display:block;
  padding-bottom:6px;
  margin-bottom:8px;
  border-bottom:1px solid #e3e3e3;
}

.row{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:10px;
}

.memo-row{
  align-items:flex-start;
}

.toggle-row{
  justify-content:space-between;
}

.toggle{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:#444;
}

.toggle-row-left{
  margin-bottom:10px;
}

.toggle-label{
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
}

.toggle-label input[type="checkbox"]{
  margin:0;
  cursor:pointer;
}

.row label{min-width:110px;}

textarea{
  padding:8px;
  border-radius:8px;
  border:1px solid #e6e6e6;
  width:100%;
  box-sizing:border-box;
  font-family:inherit;
  resize:vertical;
}

.small{font-size:13px;color:#444;}
.info{font-size:12px;color:#666;}

input[type="text"],
input[type="number"],
input[type="url"],
select{
  padding:8px;
  border-radius:8px;
  border:1px solid #e6e6e6;
  width:100%;
  box-sizing:border-box;
}

button{
  background:#d0d0d0;
  color:#222;
  border-radius:8px;
  padding:8px 10px;
  border:1px solid rgba(0,0,0,0.06);
  cursor:pointer;
}

.btn{
  margin-bottom:16px;
  background:#F0AD4E;
  color:#fff;
  border-color:#F0AD4E;
  transition:all 0.2s ease;
}

.btn:hover{
  filter:brightness(1.1);
}

.list{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:8px;
}

.list-row{
  display:flex;
  gap:8px;
  align-items:center;
}

.list-row.dragging{
  opacity:0.6;
}

.drag-handle{
  font-size:14px;
  color:#888;
  padding:4px 6px;
  border-radius:6px;
  background:#f0f0f0;
  border:1px solid #e0e0e0;
  cursor:grab;
  user-select:none;
}

.list-row input[type="text"],
.list-row input[type="number"]{
  width:auto;
  flex:1;
  min-width:0;
}

.list-row .short{
  flex:0 0 70px;
}

.param-label{
  flex:0 0 115px !important;
}

.param-value{
  flex:0 0 115px !important;
.param-bulk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
}

.dice-select{
  flex:0 0 105px;
  padding:4px;
  border:1px solid #e6e6e6;
  border-radius:6px;
  font-size:12px;
  background:#fff;
  cursor:pointer;
}

.param-bulk-divider {
  border-bottom: 1px solid #e3e3e3;
  margin: 2px 0 6px 0;
}
.dice-input{
  flex:0 0 105px;
  padding:4px;
  border:1px solid #e6e6e6;
  border-radius:6px;
  font-size:12px;
}

.roll-btn{
  flex:0 0 auto;
  padding:4px 8px;
  background:#F0AD4E;
  color:#fff;
  border:1px solid #F0AD4E;
  border-radius:6px;
  font-size:11px;
  cursor:pointer;
  transition:all 0.2s ease;
}

.roll-btn:hover{
  filter:brightness(1.1);
}

.list-row .remove{
  background:#ef6b6b;
  color:#fff;
}

.output{
  background:#fafafa;
  border:1px solid #e6e6e6;
  border-radius:8px;
  padding:10px;
  font-size:12px;
  white-space:pre-wrap;
  word-break:break-word;
}

.auto-status-buttons{
  display:flex;
  gap:8px;
  margin-top:8px;
  flex-wrap:wrap;
}

.auto-status-btn{
  flex:1;
  min-width:70px;
  padding:8px 12px;
  font-size:13px;
}

.damage-bonus-row{
  display:flex;
  gap:8px;
  margin-top:8px;
  align-items:center;
}

.damage-bonus-btn{
  flex:0 0 50%;
  padding:8px 12px;
  font-size:13px;
  min-height:38px;
}

.damage-result{
  flex:1;
  padding:8px 12px;
  background:#f5f5f5;
  border:1px solid #e0e0e0;
  border-radius:4px;
  text-align:center;
  font-size:13px;
  font-weight:bold;
  min-height:38px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

@media (max-width: 980px){
  .container{
    flex-direction:column;
  }
  .right-column{
    width:100%;
  }
  .output-panel{
    width:100%;
    position:static;
    height:auto;
  }
}
