.smart-paste-card {
  display: grid;
  gap: var(--space-4, 16px);
  margin-bottom: var(--space-5, 20px);
  padding: 14px;
  border: 1px solid var(--color-border, #d7e2dc);
  border-radius: var(--radius-lg, 8px);
  background: var(--color-surface, #ffffff);
}

.smart-paste-card__header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.smart-paste-card__icon {
  display: inline-grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius-md, 6px);
  color: var(--color-brand, #0f8f6b);
  background: var(--color-brand-soft, #e8f5f0);
}

.smart-paste-card__icon svg,
.smart-paste-read svg {
  width: 18px;
  height: 18px;
}

.smart-paste-card__copy {
  min-width: 0;
}

.smart-paste-card__title,
.smart-paste-preview__head h4 {
  margin: 0;
  color: var(--color-text, #17201c);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.smart-paste-card__description {
  margin: 4px 0 0;
  color: var(--color-text-secondary, #66736d);
  font-size: 12px;
  line-height: 1.55;
}

.smart-paste-card__actions,
.smart-paste-preview__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.smart-paste-card__actions button,
.smart-paste-preview__actions button,
.smart-paste-preview__head button,
.smart-paste-editor button {
  min-height: 44px;
}

.smart-paste-read {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-color: var(--color-brand, #0f8f6b);
  color: #ffffff;
  background: var(--color-brand, #0f8f6b);
  font-weight: 700;
}

.smart-paste-clear {
  color: var(--color-text-secondary, #66736d);
  background: var(--color-surface, #ffffff);
}

.smart-paste-status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--color-text-secondary, #66736d);
  font-size: 11px;
  line-height: 1.5;
}

.smart-paste-status[data-state="reading"],
.smart-paste-status[data-state="parsing"] {
  color: var(--color-route, #2f72b7);
}

.smart-paste-status[data-state="partial"],
.smart-paste-status[data-state="error"] {
  color: var(--color-warning-text, #91600c);
}

.smart-paste-status[data-state="confirmed"] {
  color: var(--color-brand, #0f8f6b);
  font-weight: 700;
}

.smart-paste-editor {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-soft, #e7eeea);
}

.smart-paste-editor label,
.smart-paste-conflict > label {
  color: var(--color-text-secondary, #66736d);
  font-size: 13px;
  font-weight: 700;
}

.smart-paste-editor textarea {
  min-height: 126px;
  resize: vertical;
  line-height: 1.6;
}

.smart-paste-preview {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-soft, #e7eeea);
}

.smart-paste-compact-summary {
  display: grid;
  gap: 4px;
  border: 1px solid var(--color-border, #dce5e0);
  border-radius: var(--radius-md, 12px);
  padding: 12px;
  background: var(--color-surface-secondary, #f8faf9);
}

.smart-paste-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 3px;
  color: var(--color-brand, #0f8f6b);
  font-size: 11px;
  font-weight: 800;
}

.smart-paste-counts span:last-child {
  color: var(--color-warning, #b97808);
}

.smart-paste-compact-summary > strong {
  overflow: hidden;
  color: var(--color-text-primary, #17201c);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-paste-compact-summary > span {
  overflow: hidden;
  color: var(--color-text-secondary, #65716b);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-paste-field-details {
  border-top: 1px solid var(--color-border-soft, #e7eeea);
  padding-top: 10px;
}

.smart-paste-field-details > summary {
  width: fit-content;
  min-height: 40px;
  cursor: pointer;
  color: var(--color-route, #3478d4);
  font-size: 13px;
  font-weight: 700;
  line-height: 40px;
}

.smart-paste-field-details[open] > summary {
  margin-bottom: 6px;
}

.smart-paste-card[data-state="confirmed"] {
  gap: 10px;
}

.smart-paste-card[data-state="confirmed"] .smart-paste-card__description,
.smart-paste-card[data-state="confirmed"] .smart-paste-card__actions {
  display: none;
}

.smart-paste-card[data-state="confirmed"] .smart-paste-status {
  margin: 0;
}

.smart-paste-preview__head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.smart-paste-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--color-brand, #0f8f6b);
  font-size: 12px;
  font-weight: 700;
}

.smart-paste-fields {
  display: grid;
  border-top: 1px solid var(--color-border-soft, #e7eeea);
}

.smart-paste-preview-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-border-soft, #e7eeea);
}

.smart-paste-preview-label {
  color: var(--color-text-secondary, #66736d);
  font-size: 13px;
}

.smart-paste-preview-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text, #17201c);
  font-size: 14px;
  line-height: 1.45;
}

.smart-paste-preview-value-group {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.smart-paste-preview-source {
  overflow-wrap: anywhere;
  color: var(--color-text-tertiary, #8a958f);
  font-size: 11px;
  line-height: 1.4;
}

.smart-paste-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.smart-paste-badge.recognized {
  color: var(--color-brand, #0f8f6b);
  background: var(--color-brand-soft, #e8f5f0);
}

.smart-paste-badge.confirm {
  color: var(--color-warning-text, #91600c);
  background: var(--color-warning-soft, #fff3d8);
}

.smart-paste-warning {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 12px 12px 30px;
  border-left: 3px solid var(--color-warning, #e6a01a);
  border-radius: var(--radius-sm, 4px);
  color: var(--color-warning-text, #91600c);
  background: var(--color-warning-soft, #fff3d8);
  font-size: 13px;
  line-height: 1.5;
}

.smart-paste-raw {
  color: var(--color-text-secondary, #66736d);
  font-size: 13px;
}

.smart-paste-raw summary {
  width: fit-content;
  cursor: pointer;
}

.smart-paste-raw pre {
  max-height: 180px;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--color-border-soft, #e7eeea);
  border-radius: var(--radius-sm, 4px);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--color-text, #17201c);
  background: var(--color-bg, #f3f7f4);
  font: inherit;
}

.smart-paste-conflict {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--color-warning-border, #efd190);
  border-radius: var(--radius-md, 6px);
  background: var(--color-warning-soft, #fff3d8);
}

.smart-paste-conflict select {
  background: #ffffff;
}

.smart-paste-conflict-list {
  display: grid;
  gap: 10px;
}

.smart-paste-conflict-row {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--color-warning-border, #efd190);
}

.smart-paste-conflict-values {
  display: grid;
  gap: 3px;
  color: var(--color-text-secondary, #66736d);
  font-size: 12px;
}

.smart-paste-conflict-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.smart-paste-choice {
  display: inline-flex;
  grid-template-columns: none;
  gap: 7px;
  align-items: center;
  color: var(--color-text, #17201c);
  font-size: 13px;
}

.smart-paste-choice input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--color-brand, #0f8f6b);
}

.smart-paste-preview__actions {
  grid-template-columns: minmax(112px, 0.7fr) minmax(0, 1.3fr);
}

@media (min-width: 800px) {
  .smart-paste-card {
    width: min(100%, 760px);
    margin-right: auto;
    margin-left: auto;
    padding: 16px;
  }
}

@media (max-width: 390px) {
  .smart-paste-preview-row {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .smart-paste-badge {
    grid-column: 2;
    width: fit-content;
  }

  .smart-paste-preview__actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .smart-paste-card * {
    scroll-behavior: auto !important;
  }
}
