.subtitle { font-size: 12px; color: var(--ink-light); font-weight: 300; letter-spacing: 0.1em; border-left: 2px solid var(--accent); padding-left: 10px; }
.panel-header { padding:10px 16px; border-bottom:1px solid var(--border); background:var(--bg); display:flex; justify-content:space-between; align-items:center; gap:12px; }
.panel-label { font-size:10px; letter-spacing:.2em; color:var(--ink-light); text-transform:uppercase; }
.panel-body { padding:18px; }
.hidden { display:none !important; }
.tool-form { display:flex; flex-direction:column; gap:12px; }
.tool-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.tool-note { font-size:12px; color:var(--ink-light); line-height:1.7; }
.result-list { display:flex; flex-direction:column; gap:8px; }
.file-item { border:1px solid var(--border); border-radius:8px; background:#fff; padding:10px 12px; display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:13px; }
.file-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); font-weight:500; }
.file-meta { color:var(--ink-light); font-size:12px; white-space:nowrap; }
.preview-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; }
.preview-card { border:1px solid var(--border); background:#fff; border-radius:10px; padding:10px; display:flex; flex-direction:column; gap:8px; }
.preview-card img, .preview-card canvas { width:100%; height:110px; object-fit:contain; background:#f7f7f7; border:1px solid var(--border); border-radius:6px; }
.textarea-tall { min-height:420px; padding:18px 20px; font-size:14px; line-height:1.8; font-weight:400; font-family:"Noto Sans JP", Consolas, monospace; }
.output-box { min-height:240px; white-space:pre-wrap; word-break:break-word; background:#fff; border:1px solid var(--border); padding:18px 20px; font-size:14px; line-height:1.8; }
.small-btn { border:1px solid var(--border); background:#fff; color:var(--ink); border-radius:6px; padding:8px 12px; font-size:12px; font-weight:700; cursor:pointer; }
.small-btn:hover { border-color:var(--blue); color:var(--blue); background:var(--blue-light); }
.copy-btn.copied { background:#3A7D44 !important; }
.color-sample { width:100%; min-height:90px; border:1px solid var(--border); border-radius:10px; display:flex; align-items:center; justify-content:center; font-weight:700; }
@media (max-width:900px){ .textarea-tall{min-height:300px;} }


  
/* ── Added tool button spacing fix ── */
.sidebar-section > .apply-btn,
.sidebar-section > .reset-btn,
.sidebar-section > .download-btn,
.sidebar-section > .small-btn {
  margin-top: 10px;
}

.sidebar-section > .sidebar-title + .apply-btn,
.sidebar-section > .sidebar-title + .reset-btn,
.sidebar-section > .sidebar-title + .download-btn,
.sidebar-section > .sidebar-title + .small-btn {
  margin-top: 12px;
}

.sidebar-section > .apply-btn + .reset-btn,
.sidebar-section > .apply-btn + .download-btn,
.sidebar-section > .apply-btn + .small-btn,
.sidebar-section > .reset-btn + .small-btn,
.sidebar-section > .reset-btn + .download-btn,
.sidebar-section > .small-btn + .small-btn,
.sidebar-section > .small-btn + .download-btn,
.sidebar-section > .download-btn + .reset-btn,
.sidebar-section > .download-btn + .small-btn {
  margin-top: 10px;
}

.sidebar-section .download-btn.hidden {
  display: none !important;
}

.sidebar-section .tool-form + .apply-btn,
.sidebar-section .tool-form + .reset-btn,
.sidebar-section .tool-form + .small-btn {
  margin-top: 12px;
}


.drop-zone input[type="file"] { display: none; }
.workspace[style*="display:none"] { display:none !important; }


/* ── PDF rotate thumbnail selection ── */
.page-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.page-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  min-height: 190px;
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.page-card:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.page-card.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.page-card-num {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.page-card-label {
  color: var(--ink-light);
  font-size: 11px;
  font-weight: 500;
}
.page-card.selected .page-card-num,
.page-card.selected .page-card-label {
  color: var(--blue);
}
.page-thumb-wrap {
  width: 100%;
  height: 112px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #F8F9FA;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.page-thumb-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.page-thumb-loading {
  color: var(--ink-light);
  font-size: 11px;
}
.select-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
