.pcm-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
.pcm-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.pcm-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.pcm-tab {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  padding: 6px 12px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pcm-tab:hover {
  color: var(--text);
}
.pcm-tab[aria-selected="true"] {
  background: var(--text);
  color: #ffffff;
}
.pcm-tab:focus-visible,
.pcm-btn:focus-visible,
.pcm-pill:focus-visible,
.pcm-preset:focus-visible,
.pcm-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.pcm-pane[hidden] {
  display: none;
}
.pcm-dropzone {
  border: 1.5px dashed #c1c1c1;
  border-radius: var(--radius-swatch);
  padding: 32px 20px;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pcm-dropzone.is-dragover {
  border-color: var(--primary);
  background: #eef7f6;
}
.pcm-drop-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.pcm-drop-sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
}
.pcm-drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.pcm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pcm-btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.pcm-btn-primary:hover {
  background: var(--primary-hover);
}
.pcm-btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}
.pcm-btn-secondary:hover {
  background: var(--surface);
  border-color: var(--text);
}
.pcm-btn-sm {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 12px;
}
.pcm-stage-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pcm-stage-wrap[hidden] {
  display: none;
}
.pcm-canvas-box {
  position: relative;
  border-radius: var(--radius-swatch);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  line-height: 0;
  max-width: 720px;
  margin: 0 auto;
}
.pcm-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  cursor: crosshair;
  touch-action: none;
}
.pcm-pin {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #222222, 0 2px 8px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pcm-canvas-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pcm-radius-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  padding: 3px;
  border-radius: var(--radius-pill);
}
.pcm-radius-btn {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.pcm-radius-btn[aria-pressed="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.pcm-dom-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pcm-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: block;
}
.pcm-dom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pcm-dom-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 10px 4px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.pcm-dom-chip:hover {
  border-color: var(--text);
}
.pcm-dom-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(34, 34, 34, 0.16);
  flex-shrink: 0;
}
.pcm-privacy-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.pcm-hex-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.pcm-color-native {
  width: 52px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  flex-shrink: 0;
}
.pcm-input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  background: var(--card);
}
.pcm-pane[data-pane="lookup"] .pcm-input {
  font-family: var(--font-sans);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
}
.pcm-rgb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pcm-rgb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pcm-rgb-range {
  width: 100%;
  accent-color: var(--primary);
}
.pcm-lookup-list {
  margin-top: 10px;
  max-height: 270px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.pcm-lookup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-swatch);
  background: var(--card);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pcm-lookup-item:hover {
  border-color: var(--text);
  background: var(--surface);
}
.pcm-lookup-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(34, 34, 34, 0.14);
  flex-shrink: 0;
}
.pcm-lookup-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pcm-lookup-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.pcm-lookup-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.pcm-target-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-swatch);
  margin-bottom: 14px;
}
.pcm-target-chip {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(34, 34, 34, 0.16);
  flex-shrink: 0;
}
.pcm-target-info {
  min-width: 0;
  flex: 1;
}
.pcm-target-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.pcm-target-specs {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.pcm-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.pcm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pcm-pill {
  min-height: 34px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--body);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.pcm-pill:hover {
  border-color: var(--text);
}
.pcm-pill[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}
.pcm-pill-accent[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.pcm-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.pcm-swatch-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-swatch);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.pcm-swatch-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c1c1c1;
}
.pcm-swatch-strip {
  display: flex;
  height: 110px;
  border-bottom: 1px solid rgba(34, 34, 34, 0.08);
}
.pcm-swatch-main {
  flex: 1;
  position: relative;
}
.pcm-swatch-ref {
  width: 26%;
  position: relative;
}
.pcm-swatch-tag {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #222222;
}
.pcm-swatch-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.pcm-swatch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pcm-brand-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcm-de-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #eef7f6;
  color: #0f5c5c;
  white-space: nowrap;
  flex-shrink: 0;
}
.pcm-de-badge.is-good {
  background: var(--surface);
  color: var(--text);
}
.pcm-de-badge.is-fair {
  background: var(--surface);
  color: var(--muted);
}
.pcm-swatch-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.pcm-swatch-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.pcm-swatch-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.pcm-compare-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-swatch);
  background: var(--surface);
}
.pcm-compare-box[hidden] {
  display: none;
}
.pcm-compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.pcm-compare-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.pcm-compare-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(34, 34, 34, 0.14);
}
.pcm-compare-half {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
}
.pcm-compare-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.pcm-presets-band {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}
.pcm-presets-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.pcm-presets-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.pcm-presets-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.pcm-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.pcm-preset {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-swatch);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pcm-preset:hover {
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}
.pcm-preset-chip {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(34, 34, 34, 0.14);
  flex-shrink: 0;
}
.pcm-preset-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.pcm-preset-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .pcm-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pcm-presets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .pcm-panel {
    padding: 16px;
  }
  .pcm-results,
  .pcm-lookup-list {
    grid-template-columns: 1fr;
  }
  .pcm-presets-grid {
    grid-template-columns: 1fr;
  }
  .pcm-drop-actions .pcm-btn {
    width: 100%;
  }
  .pcm-swatch-actions .pcm-btn {
    flex: 1;
  }
}