@charset "UTF-8";

.wpc-cssgen {
  --c-bg: #fafaf7;
  --c-surface: #ffffff;
  --c-surface-2: #f2f2ed;
  --c-border: rgba(26, 26, 31, 0.12);
  --c-text: #1a1a1f;
  --c-text-muted: #6b6e78;
  --c-accent: #3d5378;
  --c-accent-ink: #ffffff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
}


.wpc-cssgen__tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: var(--gap-md); padding: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
}
.wpc-cssgen__tab {
  flex: 1 1 auto; min-width: max-content;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 16px; font-weight: 500;
  color: var(--c-text-muted); background: transparent;
  border: 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}
.wpc-cssgen__tab-en { font-size: 0.9rem; line-height: 1.2; }
.wpc-cssgen__tab-ja { font-size: 0.7rem; line-height: 1.2; opacity: 0.8; }
.wpc-cssgen__tab:hover { color: var(--c-text); background: var(--c-surface-2); }
.wpc-cssgen__tab.is-active { color: var(--c-accent-ink); background: var(--c-accent); }
.wpc-cssgen__tab:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.wpc-cssgen__panel { display: none; }
.wpc-cssgen__panel.is-active { display: block; }

.wpc-cssgen__layout {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--gap-md); margin-bottom: var(--gap-md);
}
@media (max-width: 768px) {
  .wpc-cssgen__layout { grid-template-columns: 1fr; }
  .wpc-cssgen__controls { order: 2; }
  .wpc-cssgen__preview { order: 1; }
}

.wpc-cssgen__preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 280px; padding: var(--gap-md);
  background: #ffffff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
}
.wpc-cssgen__preview-inner {
  width: 100%; display: flex; align-items: center; justify-content: center;
}
.wpc-cssgen__preview-box {
  width: 160px; height: 160px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(26, 26, 31, 0.08);
}
.wpc-cssgen__preview-text { font-size: 1.25rem; color: var(--c-text); margin: 0; }
.wpc-cssgen__preview-heading {
  font-size: 2.5rem; font-weight: 700; color: var(--c-text); margin: 0;
}
.wpc-cssgen__preview-frame {
  width: 240px; height: 180px; overflow: hidden;
  background: var(--c-surface-2); border-radius: var(--radius-sm);
}
.wpc-cssgen__preview-img { width: 100%; height: 100%; display: block; }

.wpc-cssgen__controls {
  padding: var(--gap-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
}
.wpc-cssgen__placeholder {
  color: var(--c-text-muted); font-size: 0.9rem;
  text-align: center; margin: 0; padding: 40px 0;
}
.wpc-cssgen__field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.wpc-cssgen__field-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.wpc-cssgen__label {
  font-size: 0.8rem; font-weight: 500; color: var(--c-text-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.wpc-cssgen__value {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--c-accent);
}
.wpc-cssgen__input,
.wpc-cssgen__select {
  width: 100%; padding: 8px 10px; font-size: 0.9rem;
  color: var(--c-text); background: var(--c-surface-2);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-family: inherit;
  transition: border-color 0.15s;
}
.wpc-cssgen__input:focus,
.wpc-cssgen__select:focus { outline: none; border-color: var(--c-accent); }
.wpc-cssgen__range {
  width: 100%; accent-color: var(--c-accent);
}

/* Clamp simulator */
.wpc-cssgen__sim-frame {
  width: 100%;
  height: 100%;
  min-height: 240px;
  border: 0;
  background: #fff;
  display: block;
  border-radius: var(--radius-sm);
}
.wpc-cssgen__preview[data-preview="clamp"] {
  padding: 0;
  background-image: none;
  background: var(--c-surface-2);
  align-items: stretch;
  justify-content: stretch;
}

.wpc-cssgen__preview[data-preview="shadow"] {
  background: #ffffff;
}

/* Gradient editor */
.wpc-cssgen__grad-head-row {
  display: flex; align-items: flex-end; gap: 16px; margin-bottom: 14px;
}
.wpc-cssgen__dial-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0;
}
#grad-dial { cursor: crosshair; border-radius: 50%; display: block; }
.wpc-cssgen__grad-editor {
  margin-bottom: 10px;
}
.wpc-cssgen__grad-bar {
  height: 28px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--c-border);
}
.wpc-cssgen__grad-track {
  position: relative; height: 24px; margin-top: 4px;
}
.wpc-cssgen__stop-marker {
  position: absolute; top: 0; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.12);
  cursor: grab; transition: box-shadow 0.1s;
}
.wpc-cssgen__stop-marker.is-active {
  box-shadow: 0 0 0 2px var(--c-accent), 0 0 0 4px rgba(61, 83, 120, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 2;
}
.wpc-cssgen__stop-edit {
  margin-top: 8px;
  background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.wpc-cssgen__stop-all-list {
  display: flex; flex-direction: column;
}
.wpc-cssgen__stop-all-item {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 8px 12px;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--c-text-muted);
  cursor: pointer; border-bottom: 1px solid var(--c-border); transition: background 0.1s;
}
.wpc-cssgen__stop-all-item:last-child { border-bottom: none; }
.wpc-cssgen__stop-all-item:hover { background: var(--c-surface); }
.wpc-cssgen__stop-all-item.is-active { color: var(--c-text); background: rgba(61, 83, 120, 0.06); }
.wpc-cssgen__stop-all-swatch {
  width: 28px; height: 28px; border-radius: 4px; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer; border: none; padding: 0;
  display: block;
}
.wpc-cssgen__stop-hex { letter-spacing: 0.03em; }
.wpc-cssgen__stop-pct { text-align: right; opacity: 0.55; min-width: 36px; }
.wpc-cssgen__stop-row-del {
  background: none; border: none; color: var(--c-text-muted);
  cursor: pointer; padding: 0; font-size: 1rem; line-height: 1; opacity: 0;
  transition: opacity 0.1s;
}
.wpc-cssgen__stop-all-item:hover .wpc-cssgen__stop-row-del,
.wpc-cssgen__stop-all-item.is-active .wpc-cssgen__stop-row-del { opacity: 1; }
.wpc-cssgen__stop-row-del:hover { color: var(--tool-danger); }

/* Gradient stops (old list - keep for compatibility) */
.wpc-cssgen__stops-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wpc-cssgen__stop-list { display: flex; flex-direction: column; gap: 8px; }
.wpc-cssgen__stop-item {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.wpc-cssgen__stop-item input[type="color"] { width: 36px; height: 32px; border: none; background: none; cursor: pointer; padding: 1px 2px; }
.wpc-cssgen__stop-item input[type="range"] { flex: 1; accent-color: var(--c-accent); }
.wpc-cssgen__stop-pos { font-size: 0.8rem; font-family: var(--font-mono); color: var(--c-text-muted); min-width: 36px; }
.wpc-cssgen__stop-del { background: none; border: none; color: var(--c-text-muted); cursor: pointer; font-size: 1rem; padding: 0 2px; }
.wpc-cssgen__stop-del:hover { color: var(--tool-danger); }

/* Border radius grid */
.wpc-cssgen__radius-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.wpc-cssgen__layer-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.wpc-cssgen__btn-add {
  padding: 4px 10px; font-size: 0.8rem; font-family: inherit;
  color: var(--c-accent); background: transparent;
  border: 1px solid var(--c-accent); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s;
}
.wpc-cssgen__btn-add:hover { background: var(--c-accent); color: var(--c-accent-ink); }
.wpc-cssgen__layer-list {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.wpc-cssgen__layer-item {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 0.8rem;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s;
  color: var(--c-text-muted);
}
.wpc-cssgen__layer-item.is-active { border-color: var(--c-accent); color: var(--c-accent); }
.wpc-cssgen__layer-del {
  background: none; border: none; color: var(--c-text-muted);
  cursor: pointer; padding: 0 0 0 4px; font-size: 1rem; line-height: 1;
}
.wpc-cssgen__layer-del:hover { color: var(--tool-danger); }
.wpc-cssgen__toggle {
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
}
.wpc-cssgen__toggle input[type="checkbox"] { accent-color: var(--c-accent); width: 16px; height: 16px; }
.wpc-cssgen__toggle-label { font-size: 0.85rem; color: var(--c-text-muted); }

/* Button group */
.wpc-cssgen__btn-group {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.wpc-cssgen__btn {
  flex: 1 1 auto;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--c-text-muted);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wpc-cssgen__btn:hover {
  color: var(--c-text);
  border-color: var(--c-accent);
}
.wpc-cssgen__btn.is-active {
  color: var(--c-accent-ink);
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.wpc-cssgen__output {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.wpc-cssgen__output-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}
.wpc-cssgen__output-label {
  font-size: 0.8rem; font-weight: 600; color: var(--c-text-muted);
  letter-spacing: 0.05em; text-transform: uppercase;
}
.wpc-cssgen__copy {
  padding: 6px 14px; font-size: 0.85rem; font-weight: 600;
  color: #ffffff; background: var(--c-accent);
  border: 0; border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity 0.15s ease; font-family: inherit;
}
.wpc-cssgen__copy:hover { opacity: 0.85; }
.wpc-cssgen__copy.is-copied { background: #2a8a4a; }
.wpc-cssgen__code {
  margin: 0; padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem; line-height: 1.6;
  color: var(--c-text); background: var(--c-surface);
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* Gradient stop swatches */
.wpc-cssgen__stop-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; margin-right: 4px; }
.wpc-cssgen__stop-swatch {
  width: 28px; height: 28px; border-radius: 4px;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; flex-shrink: 0;
}
.wpc-cssgen__stop-swatch.is-active {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px var(--c-accent), 0 0 0 3px rgba(61, 83, 120, 0.25);
  transform: scale(1.15);
}