:root {
  --zbtool-shell-padding: 12px;
  --zbtool-workspace-gap: 12px;
  --scp-ink: #243449;
  --scp-muted: #66758a;
  --scp-line: #d6e0eb;
  --scp-soft: #f5f8fc;
  --scp-soft-2: #eef6ff;
  --scp-primary: #0f766e;
  --scp-primary-2: #1d4ed8;
  --scp-danger: #b42318;
  --scp-shadow: 0 24px 56px -42px rgba(21, 39, 71, 0.58);
}

.scp-tool,
.zbtool-shell .scp-tool {
  display: grid;
  gap: 12px;
}

.zbtool-shell .zbtool-social-bar {
  margin: 20px 0 6px !important;
  position: relative;
  z-index: 1;
}

.zbtool-shell .panel-work {
  padding: 14px !important;
  margin-bottom: 20px;
}

.scp-workspace,
.zbtool-shell .scp-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 1.02fr) minmax(320px, 0.98fr);
  gap: 16px;
  align-items: stretch;
}

.scp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--scp-line);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--scp-shadow);
  padding: 12px;
}

.scp-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.scp-card-head.compact {
  margin-bottom: 8px;
}

.scp-card-head h2,
.scp-card-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px 7px 10px;
  color: var(--scp-ink);
  font-size: 17px;
  line-height: 1.2;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.09) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(29, 78, 216, 0.12);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.scp-card-head h2::before,
.scp-card-head h3::before {
  content: "";
  width: 4px;
  height: 1.15em;
  border-radius: 999px;
  background: linear-gradient(180deg, #0f766e 0%, #2563eb 100%);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
}

.scp-card-head.compact h3 {
  font-size: 14px;
  padding: 6px 10px 6px 9px;
  border-radius: 12px;
}

.scp-card-head p {
  margin: 4px 0 0;
  color: var(--scp-muted);
  font-size: 12px;
  line-height: 1.5;
}

.scp-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf7f5;
  color: var(--scp-primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.scp-status-badge.is-ready {
  background: #eef8ec;
  color: #216a3f;
}

.scp-status-badge.is-warn {
  background: #fff7e8;
  color: #8a5100;
}

.scp-status-badge.is-error {
  background: #fff1f1;
  color: var(--scp-danger);
}

.scp-method-grid {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.scp-primary-actions,
.scp-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scp-primary-actions button,
.scp-secondary-actions button,
.scp-history button {
  border: 1px solid #c8d5e4;
  border-radius: 999px;
  background: #fff;
  color: #2f4157;
  padding: 7px 11px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.scp-primary-actions button:hover,
.scp-secondary-actions button:hover,
.scp-history button:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 78, 216, 0.4);
  color: #1d4ed8;
  box-shadow: 0 10px 22px -18px rgba(15, 43, 80, 0.8);
}

.scp-primary-actions .is-primary {
  border-color: rgba(29, 78, 216, 0.16);
  background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 18px 34px -24px rgba(29, 78, 216, 0.85);
}

.scp-primary-actions .is-primary:hover {
  color: #fff;
}

.scp-secondary-actions .is-quiet {
  background: #fff7f5;
  color: var(--scp-danger);
  border-color: rgba(180, 35, 24, 0.18);
}

.scp-primary-actions button:disabled,
.scp-secondary-actions button:disabled,
.scp-history button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.scp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scp-field > span {
  color: var(--scp-ink);
  font-size: 13px;
  font-weight: 600;
}

.scp-field small {
  color: var(--scp-muted);
  font-size: 12px;
  line-height: 1.45;
}

.scp-input-wrap,
.scp-file-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--scp-line);
  border-radius: 16px;
  background: #fff;
  min-height: 40px;
  padding: 0 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.scp-input-wrap:focus-within,
.scp-file-wrap:focus-within {
  border-color: rgba(29, 78, 216, 0.4);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.08);
}

.scp-input-wrap input,
.scp-file-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--scp-ink);
  font-size: 14px;
}

.scp-preview-board {
  position: relative;
  margin-top: 6px;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c7d4e3;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.05) 0%, rgba(29, 78, 216, 0.06) 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0.5) 12px, rgba(245, 248, 252, 0.85) 12px, rgba(245, 248, 252, 0.85) 24px);
  overflow: hidden;
}

.scp-preview-empty {
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--scp-muted);
  text-align: center;
  line-height: 1.45;
  font-size: 12px;
  pointer-events: none;
}

.scp-preview-board canvas[hidden] {
  display: none !important;
}

.scp-preview-board canvas {
  display: block;
  max-width: 100%;
  max-height: 260px;
  width: auto;
  height: auto;
  cursor: crosshair;
  border-radius: 18px;
  box-shadow: 0 26px 54px -36px rgba(22, 39, 69, 0.65);
  background: #fff;
}

.scp-preview-meta {
  margin-top: 6px;
  padding: 7px 9px;
  border: 1px solid var(--scp-line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--scp-soft) 0%, #fff 100%);
  color: var(--scp-muted);
  font-size: 12px;
  line-height: 1.45;
}

.scp-result-grid {
  display: grid;
  grid-template-columns: minmax(170px, 196px) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.scp-swatch-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
}

.scp-swatch {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  flex: 1;
  min-height: 96px;
  padding: 10px;
  border-radius: 16px;
  background: #2f855a;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.scp-swatch-meta,
.scp-swatch-code {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scp-swatch-meta strong {
  white-space: nowrap;
}

.scp-swatch strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.scp-swatch span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.9;
}

.scp-swatch-code {
  align-items: flex-end;
  text-align: right;
}

.scp-value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(62px, auto);
  gap: 8px;
}

.scp-value-card {
  border: 1px solid var(--scp-line);
  border-radius: 14px;
  background: #fff;
  padding: 8px 9px;
}

.scp-value-card dt {
  margin: 0 0 4px;
  color: var(--scp-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.scp-value-card dd {
  margin: 0;
  color: var(--scp-ink);
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

.scp-value-card code {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.scp-value-card--coordinates {
  grid-column: 1 / -1;
}

.scp-history-card,
.scp-tips-card {
  margin-top: 8px;
  border: 1px solid var(--scp-line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--scp-soft) 0%, #fff 100%);
  padding: 9px;
}

.scp-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scp-history button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
}

.scp-chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(36, 52, 73, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.scp-history-empty {
  color: var(--scp-muted);
  font-size: 12px;
  line-height: 1.45;
}

.scp-notice {
  min-height: 16px;
  margin: auto 2px 0;
  color: var(--scp-muted);
  font-size: 12px;
  line-height: 1.35;
}

.scp-notice.is-ok {
  color: #146c43;
}

.scp-notice.is-warn {
  color: var(--scp-danger);
}

.scp-tips {
  margin: 0;
  padding-left: 16px;
  color: var(--scp-muted);
  line-height: 1.45;
  font-size: 12px;
}

.scp-tips li + li {
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .scp-workspace,
  .zbtool-shell .scp-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .scp-card {
    padding: 12px;
    border-radius: 16px;
  }

  .scp-card-head {
    display: block;
  }

  .scp-card-head h2,
  .scp-card-head h3 {
    width: fit-content;
    max-width: 100%;
  }

  .scp-status-badge {
    margin-top: 10px;
  }

  .scp-result-grid,
  .scp-value-grid {
    grid-template-columns: 1fr;
  }

  .scp-value-card--coordinates {
    grid-column: auto;
  }

  .scp-preview-board {
    min-height: 100px;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .scp-primary-actions button,
  .scp-secondary-actions button,
  .scp-history button {
    flex-basis: 100%;
    justify-content: center;
  }

  .scp-swatch {
    min-height: 90px;
  }
}
