.panel {
  width: 340px;
  min-width: 340px;
  height: 100vh;
  background: #ffffff;
  padding: 20px;
  border-right: 1px solid #dddddd;
  overflow-y: auto;
}

.panel h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 22px;
}

.panel label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: bold;
  font-size: 14px;
}

.panel input[type="text"],
.panel textarea,
.panel select {
  width: 100%;
  padding: 10px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
}

.panel textarea {
  min-height: 90px;
  resize: vertical;
}

.panel input[type="file"],
.panel input[type="range"],
.panel input[type="color"] {
  width: 100%;
}

.panel input[type="color"] {
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.panel .check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-weight: normal;
}

.panel .check input {
  width: auto;
}

.panel button {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #3b82f6;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
}

.panel button:hover {
  background: #2563eb;
}

.panel hr {
  margin: 22px 0;
  border: none;
  border-top: 1px solid #dddddd;
}

.job-group {
  margin-bottom: 15px;
}

.job-title {
  font-size: 13px;
  font-weight: bold;
  margin: 10px 0 6px;
  color: #666;
}

.main-job-buttons,
.sub-job-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.main-job-buttons label,
.sub-job-buttons label {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 12px;
  margin: 0;
  font-weight: normal;
}

.main-job-buttons input,
.sub-job-buttons input {
  display: none;
}

.main-job-buttons label:has(input:checked) {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.sub-job-buttons label:has(input:checked) {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.notice-box {
  margin: 12px 0 18px;
  padding: 12px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e5;
  color: #5c4200;
  font-size: 13px;
  line-height: 1.6;
}

.notice-box strong {
  display: block;
  margin-bottom: 6px;
}


@media (max-width: 900px) {
  .panel {
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #dddddd;
  }
}
@media (max-width:768px){

  input,
  textarea,
  select{
    font-size:16px;
    min-height:44px;
    width:100%;
    box-sizing:border-box;
  }

  textarea{
    min-height:140px;
    line-height:1.5;
  }

  .panel label{
    display:block;
    margin-top:10px;
    margin-bottom:4px;
  }

  body.editing .preview{
    position:static !important;
    top:auto !important;
  }

}


.noframe-options {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dddddd;
  border-radius: 10px;
  background: #f8fafc;
}


.hint-text {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #666666;
}

.bg-edit-check {
  margin-top: 10px;
}


.activity-controls {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}

.activity-controls label {
  margin-top: 0;
  font-size: 12px;
  opacity: .85;
}

.activity-controls input[type="range"] {
  width: 100%;
}

.activity-controls span {
  display: inline-block;
  min-width: 54px;
  font-size: 12px;
  opacity: .9;
}

/* v31.2: 見開き専用オプション */
.spread-options {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #d8c8b6;
  border-radius: 10px;
  background: #fff8ed;
}

.spread-options[hidden] {
  display: none !important;
}

#magazineTitleCustom {
  margin-top: 8px;
}

/* v31.4.1: mobile fix for checkbox/radio option grids */
.panel input[type="checkbox"],
.panel input[type="radio"] {
  width: auto;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
}

.spread-job-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 16px;
}

.spread-job-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #dccbb8;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  word-break: keep-all;
  overflow-wrap: normal;
  cursor: pointer;
}

.spread-job-options label:has(input:checked) {
  background: #7a4f32;
  color: #fff;
  border-color: #7a4f32;
}

@media (max-width: 768px) {
  .panel input[type="checkbox"],
  .panel input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    flex: 0 0 18px;
    box-sizing: border-box;
  }

  .panel .check {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
  }

  .spread-options {
    padding: 12px;
    overflow: hidden;
  }

  .spread-job-options {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .spread-job-options label {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    font-size: 15px;
    min-height: 44px;
    padding: 10px 12px;
  }

  .main-job-buttons input,
  .sub-job-buttons input {
    display: none !important;
  }
}

/* v31.5: Magazine Theme selector */
#spreadThemeSelect {
  font-weight: 700;
}


/* v33.1.1: Android Chrome keyboard / scroll fix */
@media (max-width: 900px) {
  .panel {
    height: auto !important;
    min-height: calc(100dvh - 64px);
    max-height: none !important;
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-edit .panel {
    overflow-y: visible !important;
    touch-action: pan-y;
  }
}

/* v33.2.0: Activity Time design controls */
.activity-design-controls {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #f8fafc;
}

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

.activity-color-grid label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.activity-color-grid input[type="color"] {
  margin-top: 4px;
}

@media (max-width: 768px) {
  .activity-color-grid {
    grid-template-columns: 1fr;
  }
}
