/* CSS Clip-Path Generator - Content Area Styles */
:root {
  --ccp-bg: #ffffff;
  --ccp-surface: #f8fafc;
  --ccp-card: #ffffff;
  --ccp-border: #e2e8f0;
  --ccp-line: #cbd5e1;
  --ccp-ink: #0f172a;
  --ccp-ink-soft: #475569;
  --ccp-ink-faint: #94a3b8;
  --ccp-primary: var(--tf-accent, #0284c7);
  --ccp-primary-hover: #0369a1;
  --ccp-green: #15803d;
  --ccp-radius: 2px;
}

.ccp-main {
  width: 100%;
  color: var(--ccp-ink);
}

.ccp-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Controls bar */
.ccp-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--ccp-surface);
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
}

.ccp-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ccp-control-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ccp-ink-soft);
}

/* 2-column Grid */
.ccp-editor-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 880px) {
  .ccp-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.ccp-panel {
  background: var(--ccp-card);
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.ccp-stage-panel,
.ccp-preview-panel,
.ccp-results-panel {
  position: relative;
}

.ccp-panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  color: var(--ccp-ink);
}

.ccp-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.ccp-stage-hint {
  font-size: 0.75rem;
  color: var(--ccp-ink-soft);
}

.ccp-ad {
  overflow: hidden;
  min-height: 280px;
}

/* Canvas Stage */
.ccp-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 400px;
  margin: 0 auto;
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  background: #f1f5f9;
}

.ccp-clipped-element {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #6366f1 100%);
  transition: clip-path 0.05s ease-out;
}

.ccp-handles-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.ccp-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border: 2px solid var(--ccp-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  touch-action: none;
}

.ccp-handle:active {
  cursor: grabbing;
  background: var(--ccp-primary);
}

.ccp-canvas-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ccp-point-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ccp-ink-soft);
}

/* Code Header & Textarea */
.ccp-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ccp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ccp-textarea,
.ccp-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--ccp-ink);
  background: var(--ccp-card);
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
  font-family: inherit;
  box-sizing: border-box;
}

.ccp-textarea {
  resize: vertical;
}

.ccp-code-font {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Coordinates List */
.ccp-coords-card {
  padding: 12px;
  background: var(--ccp-surface);
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
}

.ccp-coords-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 6px 0;
  color: var(--ccp-ink-soft);
}

.ccp-coords-scroll {
  max-height: 100px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 4px;
}

.ccp-coord-chip {
  padding: 2px 6px;
  background: var(--ccp-card);
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
}

/* Callout */
.ccp-callout {
  padding: 14px;
  background: var(--ccp-surface);
  border-left: 3px solid var(--ccp-primary);
  border-radius: 0 var(--ccp-radius) var(--ccp-radius) 0;
}

.ccp-callout-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--ccp-ink);
}

.ccp-callout-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
  color: var(--ccp-ink-soft);
}

/* Action Bar */
.ccp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--ccp-radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease;
  background: var(--ccp-primary);
  color: #ffffff;
}

.ccp-btn:hover {
  background: var(--ccp-primary-hover);
}

.ccp-btn-primary {
  background: var(--ccp-primary);
  color: #ffffff;
}

.ccp-btn-primary:hover {
  background: var(--ccp-primary-hover);
}

.ccp-btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.ccp-btn-secondary {
  background: var(--ccp-surface);
  color: var(--ccp-ink);
  border-color: var(--ccp-line);
}

.ccp-btn-secondary:hover {
  background: var(--ccp-card);
  border-color: var(--ccp-ink);
}

/* Hero Summary */
.ccp-summary-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ccp-hero-card {
  padding: 20px;
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
  background: var(--ccp-surface);
}

.ccp-hero-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ccp-ink-soft);
  margin-bottom: 6px;
}

.ccp-hero-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ccp-primary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.ccp-hero-sub {
  font-size: 0.8125rem;
  color: var(--ccp-ink-soft);
}

/* Stat Grid */
.ccp-grid {
  display: grid;
}

.ccp-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.ccp-stat-grid {
  margin-top: 16px;
}

.ccp-stat-box {
  padding: 14px;
  background: var(--ccp-card);
  border: 1px solid var(--ccp-line);
  border-radius: var(--ccp-radius);
}

.ccp-stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ccp-ink-soft);
  margin-bottom: 4px;
}

.ccp-stat-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ccp-ink);
  font-variant-numeric: tabular-nums;
}

.ccp-stat-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--ccp-ink-soft);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .ccp-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .ccp-control-group {
    justify-content: space-between;
  }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --ccp-bg: var(--tf-surface);
  --ccp-surface: var(--tf-surface);
  --ccp-card: var(--tf-surface);
  --ccp-border: var(--tf-surface);
  --ccp-line: #98abc3;
  --ccp-ink: var(--tf-ink);
  --ccp-ink-soft: var(--tf-ink-soft);
  --ccp-ink-faint: var(--tf-ink-faint);
  --ccp-primary-hover: #69aed4;
  --ccp-green: #5ed089;
}
