/* 3D-Druck Service – Frontend */
.d3ps { --d3ps-accent: #66cc33; --d3ps-bg: #f4f7fa; --d3ps-border: #d7dee6; max-width: 980px; margin: 0 auto; font-size: 16px; line-height: 1.5; }
.d3ps * { box-sizing: border-box; }
.d3ps h3 { margin-top: 0; }
.d3ps-muted { color: #667; font-size: 0.9em; }
.d3ps-hint { background: #fff8e1; border-left: 3px solid #f0b429; padding: 8px 10px; font-size: 0.9em; border-radius: 0 6px 6px 0; }
.d3ps-info { background: #eef8e6; border-left: 3px solid var(--d3ps-accent); padding: 10px 12px; border-radius: 0 6px 6px 0; }
.d3ps-error { background: #fdecea; border-left: 3px solid #d93025; color: #8a1f16; padding: 10px 12px; border-radius: 0 6px 6px 0; margin-top: 12px; }
.d3ps-success { background: #e8f5e9; border-left: 3px solid #2e7d32; color: #1b5e20; padding: 12px 14px; border-radius: 0 6px 6px 0; font-size: 1.05em; }

/* Fortschritt */
.d3ps-steps { display: flex; gap: 4px; list-style: none; margin: 0 0 24px; padding: 0; flex-wrap: wrap; }
.d3ps-steps li { flex: 1; min-width: 110px; text-align: center; padding: 10px 6px; background: var(--d3ps-bg); border-bottom: 3px solid var(--d3ps-border); color: #667; font-size: 0.85em; }
.d3ps-steps li span { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--d3ps-border); align-items: center; justify-content: center; margin-right: 4px; font-weight: 600; }
.d3ps-steps li.is-active { border-color: var(--d3ps-accent); color: #223; font-weight: 600; }
.d3ps-steps li.is-active span, .d3ps-steps li.is-done span { background: var(--d3ps-accent); color: #fff; }
.d3ps-steps li.is-done { border-color: #a3d98a; }

/* Layout */
.d3ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .d3ps-grid { grid-template-columns: 1fr; } }

/* Upload */
.d3ps-drop { border: 2px dashed var(--d3ps-border); border-radius: 10px; padding: 34px 18px; text-align: center; cursor: pointer; background: var(--d3ps-bg); transition: border-color .15s, background .15s; }
.d3ps-drop.is-drag { border-color: var(--d3ps-accent); background: #eef8e6; }
.d3ps-drop.is-loading { opacity: 0.6; pointer-events: none; }
.d3ps-drop.is-done { border-color: #2e7d32; background: #f1f8f1; }
.d3ps-drop p { margin: 4px 0; }

.d3ps-linkbox { margin-top: 14px; border: 1px solid var(--d3ps-border); border-radius: 8px; padding: 10px 14px; background: #fff; }
.d3ps-linkbox summary { cursor: pointer; font-weight: 600; }
.d3ps-linkbox input { width: 100%; margin-top: 4px; }

/* Viewer */
.d3ps-viewer { width: 100%; height: 360px; border-radius: 10px; background: #1c2733; position: relative; overflow: hidden; }
.d3ps-viewer canvas { display: block; border-radius: 10px; }
.d3ps-viewer-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8aa; }
.d3ps-viewer-snapshot { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Karten & Tabellen */
.d3ps-card { border: 1px solid var(--d3ps-border); border-radius: 10px; padding: 14px 16px; margin-top: 14px; background: #fff; }
.d3ps-card h4 { margin: 0 0 8px; }
.d3ps-table { width: 100%; border-collapse: collapse; }
.d3ps-table td { padding: 6px 8px; border-bottom: 1px solid #eef2f5; }
.d3ps-table td:first-child { color: #667; width: 45%; }
.d3ps-qty { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; }
.d3ps-qty input { width: 80px; }

/* Auswahl-Kacheln */
.d3ps-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.d3ps-choice { display: block; border: 2px solid var(--d3ps-border); border-radius: 10px; padding: 14px 16px; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.d3ps-choice:has(input:checked) { border-color: var(--d3ps-accent); box-shadow: 0 0 0 3px rgba(102,204,51,0.15); }
.d3ps-choice input { position: absolute; opacity: 0; }
.d3ps-choice h4 { margin: 0 0 6px; }
.d3ps-choice p { margin: 0 0 6px; font-size: 0.92em; }

.d3ps-radio { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.d3ps-radio input { margin-top: 4px; }

/* Farben */
.d3ps-colorwrap { margin-top: 18px; }
.d3ps-color { border: 2px solid var(--d3ps-border); background: #fff; border-radius: 20px; padding: 6px 16px; margin: 4px 6px 4px 0; cursor: pointer; }
.d3ps-color.is-active { border-color: var(--d3ps-accent); background: #eef8e6; font-weight: 600; }

/* Abschluss */
.d3ps-price { font-size: 2em; font-weight: 700; color: var(--d3ps-accent); margin: 14px 0 4px; }
#d3ps-inquiry label { display: block; margin: 12px 0; font-weight: 600; }
#d3ps-inquiry input, #d3ps-inquiry textarea { width: 100%; font-weight: 400; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--d3ps-border); border-radius: 6px; }

/* Buttons & Navigation */
.d3ps-nav { display: flex; justify-content: space-between; margin-top: 26px; gap: 12px; }
.d3ps-btn { padding: 10px 22px; border-radius: 8px; border: 1px solid var(--d3ps-border); background: #fff; cursor: pointer; font-size: 1em; }
.d3ps-btn:hover { border-color: var(--d3ps-accent); }
.d3ps-btn-primary { background: var(--d3ps-accent); border-color: var(--d3ps-accent); color: #fff; font-weight: 600; }
.d3ps-btn-primary:hover { background: #549e28; }
.d3ps-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.d3ps-btn:focus-visible { outline: 3px solid rgba(102,204,51,0.45); outline-offset: 2px; }

/* Slicing-Ladeanzeige & Badges */
.d3ps-slicing { display: flex; align-items: center; gap: 12px; padding: 20px; color: #445; }
.d3ps-spinner { width: 22px; height: 22px; border: 3px solid var(--d3ps-border); border-top-color: var(--d3ps-accent); border-radius: 50%; animation: d3ps-spin .8s linear infinite; flex: 0 0 auto; }
@keyframes d3ps-spin { to { transform: rotate(360deg); } }
.d3ps-badge { display: inline-block; margin-top: 10px; font-size: 0.85em; color: #667; }
.d3ps-badge-ok { color: #1b7f37; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .d3ps-spinner { animation: none; } }

/* Zusatz: Info-Listen (z. B. 3MF-Platten-Erkennung) */
.d3ps-plainlist { margin: 8px 0 0; padding-left: 18px; }
.d3ps-plainlist li { margin-bottom: 4px; }

/* 3MF-Platten- & Farberkennung */
.d3ps-plates { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.d3ps-plate-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.92em; padding: 6px 8px; background: var(--d3ps-bg); border-radius: 6px; }
.d3ps-plate-label { font-weight: 600; min-width: 62px; }
.d3ps-plate-meta { color: #667; }
.d3ps-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); vertical-align: middle; }

/* Mehrplatten: Material-Zuordnung je Platte */
.d3ps-plate-row { flex-wrap: wrap; }
.d3ps-plate-material { flex-basis: 100%; font-size: 0.9em; color: #445; margin-top: 4px; }
.d3ps-plate-material select { margin-left: 4px; }

/* Mehrplatten-Karten in Schritt 2 */
.d3ps-plate-card { border: 1px solid var(--d3ps-border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.d3ps-plate-card h4 { margin: 0 0 8px; }
.d3ps-plate-note { margin-top: 2px; }
.d3ps-plate-colors { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.d3ps-color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.94em; }
.d3ps-error-inline { color: #b3261e; }
.d3ps-plate-mat-select, .d3ps-plate-color-select { padding: 4px 8px; border: 1px solid var(--d3ps-border); border-radius: 6px; }

/* Vereinfachte Mehrplatten-UI (v1.4.1) */
.d3ps-warn { background: #fff6e5; border-left: 3px solid #f0a400; padding: 10px 12px; border-radius: 0 6px 6px 0; }
.d3ps-badge-warn { background: #fff0d0; color: #8a5b00; }
.d3ps-plate-card-action { border-color: #f0a400; box-shadow: 0 0 0 3px rgba(240,164,0,0.10); }
.d3ps-color-row-action { background: #fff6e5; padding: 6px 8px; border-radius: 6px; }
.d3ps-linkbtn { background: none; border: none; color: var(--d3ps-accent); cursor: pointer; text-decoration: underline; padding: 0; font-size: 0.92em; }
.d3ps-linkbtn:hover { color: #549e28; }
.d3ps-plate-matline { margin-bottom: 4px; }

/* Upload-Animation (v1.5.1) */
.d3ps-drop.is-loading { border-color: var(--d3ps-accent); background: #eef8e6; position: relative; }
.d3ps-drop.is-loading p strong::after {
	content: '';
	display: inline-block;
	width: 14px; height: 14px;
	margin-left: 8px;
	vertical-align: -2px;
	border: 2px solid var(--d3ps-accent);
	border-top-color: transparent;
	border-radius: 50%;
	animation: d3ps-spin 0.8s linear infinite;
}
@keyframes d3ps-spin { to { transform: rotate(360deg); } }

/* Farb-Chips in der Zusammenfassung */
.d3ps-color-chip-inline { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.d3ps-color-chip-inline .d3ps-swatch { width: 15px; height: 15px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,0.15); }

/* Abbrechen / Von vorne beginnen */
.d3ps-final-actions { display: flex; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--d3ps-border); }
.d3ps-btn-cancel { color: #b3261e; border-color: #e8b4ae; }
.d3ps-btn-cancel:hover { background: #fdf0ee; }

/* SLA: Mehrteile-Liste (1.14.0) */
.d3ps-sla-parts-list { list-style: none; margin: 10px 0; padding: 0; }
.d3ps-sla-parts-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border: 1px solid var(--d3ps-border); border-radius: 6px; margin-bottom: 6px; background: #fafafa; font-size: 0.92em; }
.d3ps-sla-parts-list li em { color: #777; font-style: normal; font-size: 0.9em; }
.d3ps-sla-part-remove { padding: 2px 9px; font-size: 0.85em; line-height: 1.4; }
