.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; }
.color-code-font {
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.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;
}


/* ── Improved color converter ── */
.color-preview-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.color-preview-large {
  width: 100%;
  min-height: 170px;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.color-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.color-info-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}
.color-info-label {
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--ink-light);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.color-info-value {
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.result-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.result-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
}
.result-type {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-light);
  text-transform: uppercase;
}
.result-value {
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
}
.copy-value-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.copy-value-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.palette-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.palette-swatch {
  height: 58px;
}
.palette-body {
  padding: 8px 10px;
}
.palette-name {
  font-size: 11px;
  color: var(--ink-light);
  margin-bottom: 2px;
}
.palette-code {
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.alpha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.alpha-row input[type="range"] {
  flex: 1;
}
.alpha-value {
  min-width: 44px;
  text-align: right;
  color: var(--ink-light);
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 12px;
  font-weight: 500;
}
.color-input-large {
  min-height: 46px;
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 15px;
  font-weight: 600;
}
@media (max-width: 700px) {
  .result-card {
    grid-template-columns: 1fr;
  }
}


.eyedropper-btn {
  width: 100%;
}
.eyedropper-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* ── Color slider controls ── */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.color-slider-row {
  display: grid;
  grid-template-columns: 28px 1fr 42px;
  gap: 10px;
  align-items: center;
}
.color-slider-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}
.color-slider-value {
  font-size: 12px;
  color: var(--ink-light);
  text-align: right;
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.color-slider-row input[type="range"] {
  width: 100%;
}
#redRange {
  accent-color: #ef4444;
}
#greenRange {
  accent-color: #22c55e;
}
#blueRange {
  accent-color: #3b82f6;
}
#hueRange {
  accent-color: #8b5cf6;
}
#satRange {
  accent-color: #f59e0b;
}
#lightRange {
  accent-color: #64748b;
}
.slider-section-note {
  font-size: 11px;
  color: var(--ink-light);
  line-height: 1.7;
}


/* ── Visual color picker ── */
.visual-color-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.color-plane {
  position: relative;
  width: 100%;
  height: 190px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: crosshair;
  background: hsl(221, 100%, 50%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  touch-action: none;
}
.plane-white,
.plane-black {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.plane-white {
  background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}
.plane-black {
  background: linear-gradient(to top, #000, rgba(0,0,0,0));
}
.plane-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
  transform: translate(-50%, -50%);
  left: 83%;
  top: 47%;
  pointer-events: none;
}
.hue-picker-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
  align-items: center;
}
.hue-range {
  width: 100%;
  accent-color: #8b5cf6;
}
.hue-value {
  font-size: 12px;
  color: var(--ink-light);
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-weight: 500;
  text-align: right;
}
.picker-values {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.picker-values span {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ink-light);
  font-family: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-size: 11px;
  font-weight: 700;
}


/* ── Hue slider label improvement ── */
.hue-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.hue-label-main {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}
.hue-label-sub {
  font-size: 10px;
  color: var(--ink-light);
  line-height: 1.5;
  text-align: right;
}
.hue-range {
  appearance: none;
  -webkit-appearance: none;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(
    to right,
    #ff0000 0%,
    #ffff00 16.6%,
    #00ff00 33.3%,
    #00ffff 50%,
    #0000ff 66.6%,
    #ff00ff 83.3%,
    #ff0000 100%
  );
  outline: none;
  cursor: pointer;
}
.hue-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #111827;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
}
.hue-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #111827;
  box-shadow: 0 0 0 1px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
}
@media (max-width: 520px) {
  .hue-label-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .hue-label-sub {
    text-align: left;
  }
}


/* ── Alpha preview background ── */
.color-preview-large {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(45deg, #d7dbe2 25%, transparent 25%),
    linear-gradient(-45deg, #d7dbe2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7dbe2 75%),
    linear-gradient(-45deg, transparent 75%, #d7dbe2 75%);
  background-color: #f8fafc;
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0px;
}
.color-preview-large::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--preview-color, #2563EB);
  opacity: var(--preview-alpha, 1);
  z-index: 0;
}
.color-preview-large span {
  position: relative;
  z-index: 1;
}


/* ── White alpha preview background ── */
.color-preview-large {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}
