.model3d-panel { --model3d-ink: #334155; --model3d-muted: #52647d; --model3d-line: #dbe4ef; --model3d-blue: #2563eb; flex: 1; min-height: 0; overflow: auto; padding: 56px 32px 48px; color: var(--model3d-ink); background: #fff; }
.model3d-panel *, .model3d-panel *::before, .model3d-panel *::after { box-sizing: border-box; }
.model3d-panel[hidden], .model3d-panel [hidden] { display: none !important; }
.model3d-inner { max-width: 820px; margin: 0 auto; }
.model3d-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.model3d-header h1 { color: #1e293b; font-size: 24px; line-height: 1.4; font-weight: 650; margin: 0; letter-spacing: -.02em; }
.model3d-trial { display: inline-block; margin-left: 10px; padding: 2px 7px; border-radius: 5px; color: #1d4ed8; background: #eff6ff; font-size: 12px; font-weight: 500; vertical-align: middle; letter-spacing: 0; }
#confirm-modal.confirm-primary #confirm-ok { background: #2563eb; box-shadow: none; }
#confirm-modal.confirm-primary #confirm-ok:hover { background: #1d4ed8; }
#confirm-modal.confirm-primary #confirm-message { white-space: pre-line; line-height: 1.7; }
.model3d-intro { font-size: 14px; line-height: 1.7; color: var(--model3d-muted); margin: 8px 0 0; max-width: 60ch; }
.model3d-panel button, .model3d-panel select { min-height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--model3d-line); color: var(--model3d-ink); background: #fff; font: inherit; font-size: 13px; cursor: pointer; transition: background-color 150ms, border-color 150ms; }
.model3d-panel button:hover { background: #f1f5f9; border-color: #bccbde; }
.model3d-panel button:disabled, .model3d-panel select:disabled { opacity: .6; cursor: not-allowed; }
.model3d-panel button[aria-disabled="true"] { opacity: .65; cursor: progress; }
.model3d-panel :is(button, select, input, textarea, summary, a):focus-visible { outline: 2px solid var(--model3d-blue); outline-offset: 3px; }
.model3d-header [data-mode] { flex: 0 0 auto; background: #f8fafc; }
.model3d-form { border: 1px solid #b9c9de; border-radius: 16px; padding: 24px; background: #fff; }
.model3d-upload { position: relative; margin-bottom: 24px; border: 1px dashed #bccde4; border-radius: 10px; background: #f8faff; }
.model3d-upload .model3d-upload-target { display: flex; width: 100%; min-height: 184px; align-items: center; justify-content: center; flex-direction: column; gap: 12px; padding: 24px; border: 0; background: transparent; border-radius: 10px; }
.model3d-upload .model3d-upload-target:hover { background: #f0f5ff; }
.model3d-upload-empty { display: flex; align-items: center; gap: 10px; flex-direction: column; }
.model3d-upload-empty svg { color: #6683ad; margin-bottom: 2px; }
.model3d-upload-empty strong { color: #334155; font-size: 15px; font-weight: 500; }
.model3d-upload-empty > span { font-size: 12px; color: var(--model3d-muted); }
.model3d-upload img { display: block; max-width: 100%; width: auto; max-height: 220px; object-fit: contain; border-radius: 5px; }
.model3d-upload.has-image .model3d-upload-target { min-height: 0; padding: 12px; gap: 4px; }
.model3d-image-change { font-size: 13px; color: var(--model3d-blue); }
.model3d-drop-hint { display: none; position: absolute; inset: 0; border-radius: 10px; background: #eff6ff; color: #1d4ed8; align-items: center; justify-content: center; pointer-events: none; font-size: 15px; }
.model3d-upload.is-dragging { border-color: var(--model3d-blue); border-style: solid; }
.model3d-upload.is-dragging .model3d-drop-hint { display: flex; }
.model3d-prompt-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.model3d-field { display: block; font-size: 13px; font-weight: 600; margin: 0; }
.model3d-panel .model3d-text-button { border-color: transparent; background: transparent; color: #466387; padding: 5px 0; min-height: 32px; }
.model3d-panel .model3d-text-button:hover { color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; background: transparent; border-color: transparent; }
.model3d-prompt { display: block; width: 100%; min-height: 130px; padding: 12px 14px; line-height: 1.8; border: 1px solid var(--model3d-line); border-radius: 8px; resize: vertical; font: inherit; font-size: 14px; color: #334155; background: #fff; }
.model3d-panel :is(input, textarea)::placeholder { color: #64748b; opacity: 1; }
.model3d-counter { font-size: 11px; color: var(--model3d-muted); text-align: right; padding-top: 6px; }
.model3d-dimension { margin: 8px 0 20px; }
.model3d-dimension summary { cursor: pointer; font-size: 13px; padding: 8px 0; }
.model3d-dimension summary span { color: var(--model3d-muted); font-size: 12px; margin-left: 5px; }
.model3d-dimension-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 6px 0 4px; }
.model3d-dimension-fields label { display: grid; gap: 7px; font-size: 13px; min-width: 0; flex: 1 1 140px; }
.model3d-dimension-fields input { min-height: 40px; width: 100%; padding: 8px 12px; border: 1px solid var(--model3d-line); border-radius: 8px; color: #334155; background: #fff; font: inherit; }
.model3d-form-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--model3d-line); }
.model3d-model-field { display: grid; gap: 7px; min-width: 0; }
.model3d-model-field select { max-width: 260px; min-width: 190px; background: #f8fafc; }
.model3d-submit { display: flex; width: 100%; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.model3d-submit [data-price] { max-width: 200px; text-align: right; }
.model3d-panel .model3d-primary { background: var(--model3d-blue); color: #fff; border-color: var(--model3d-blue); min-height: 42px; padding: 10px 20px; font-weight: 500; }
.model3d-panel .model3d-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.model3d-model-help { flex: 1 0 100%; margin: 0; }
.model3d-model-help:empty { display: none; }
.model3d-plans { width: 100%; min-width: 0; border: 0; padding: 0; margin: 2px 0 0; }
.model3d-plans legend { padding: 0; margin-bottom: 8px; }
.model3d-plan-options { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.model3d-plan-option { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; font-size: 13px; line-height: 1.6; cursor: pointer; }
.model3d-plan-option input { accent-color: var(--model3d-blue); flex: 0 0 auto; width: 16px; height: 16px; margin: 3px 0 0; }
.model3d-plan-option small { color: #1d4ed8; font-size: 11px; }
.model3d-plan-option.is-selected { color: #1d4ed8; }
.model3d-plan-option.is-unavailable { color: var(--model3d-muted); }
.model3d-plan-option:has(input:disabled) { cursor: not-allowed; }
.model3d-plan-price { display: block; color: var(--model3d-muted); font-size: 12px; }
.model3d-plan-description { margin: 6px 0 0; }
.model3d-plan-description:empty { display: none; }
.model3d-plan-budget { margin-top: 5px; }
.model3d-plan-budget summary { width: fit-content; cursor: pointer; padding: 5px 0; font-size: 12px; color: var(--model3d-muted); }
.model3d-plan-budget p { margin: 2px 0 0; max-width: 65ch; }
.model3d-status { margin: 14px 0; color: #475569; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.model3d-status:empty { display: none; }
.model3d-error { color: #b91c1c !important; }
.model3d-small { font-size: 12px; color: var(--model3d-muted); line-height: 1.7; }
.model3d-panel.has-result { padding-top: 28px; }
.model3d-panel.has-result .model3d-inner { max-width: 1020px; }
.model3d-panel.has-result .model3d-intro { display: none; }
.model3d-panel.has-result .model3d-header { margin-bottom: 24px; align-items: center; }
.model3d-result { min-width: 0; }
.model3d-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.model3d-result-heading h2 { font-size: 16px; font-weight: 600; margin: 0; color: #1e293b; }
.model3d-result-heading p { margin: 5px 0 0; }
.model3d-state { flex-shrink: 0; color: #1d4ed8; background: #eff6ff; padding: 4px 10px; border-radius: 6px; font-size: 12px; }
.model3d-state.is-complete { color: #166534; background: #f0fdf4; }
.model3d-viewer { height: min(54vh, 540px); min-height: 290px; overflow: hidden; background: #f1f5f9; border-radius: 12px; display: grid; place-items: center; color: #475569; font-size: 14px; }
.model3d-viewer canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.model3d-viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding-top: 10px; }
.model3d-viewer-footer p { margin: 0; }
.model3d-view-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.model3d-view-controls button { min-height: 32px; min-width: 32px; padding: 4px 9px; background: #f8fafc; font-size: 12px; }
.model3d-orbit-hint { margin-right: 8px; }
.model3d-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.model3d-recovery-actions:not(:has(button:not([hidden]))) { display: none; }
.model3d-stages { display: flex; gap: 10px 24px; flex-wrap: wrap; padding: 16px 0 4px; margin: 0; list-style: none; color: var(--model3d-muted); font-size: 12px; }
.model3d-stages li { display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.model3d-stages li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.model3d-stages li[aria-current="step"] { color: #1d4ed8; font-weight: 600; }
.model3d-stages li[aria-current="step"]::before { background: #2563eb; }
.model3d-stages li.is-complete::before { background: #15803d; }
.model3d-progress { display: block; width: 100%; height: 5px; margin: 8px 0; accent-color: #2563eb; }
.model3d-downloads { border-top: 1px solid var(--model3d-line); margin-top: 24px; padding-top: 20px; }
.model3d-download-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.model3d-download-heading h3 { font-size: 14px; font-weight: 600; margin: 0; }
.model3d-download-heading span { font-size: 12px; color: var(--model3d-muted); }
.model3d-download-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.model3d-download-row label { display: grid; gap: 7px; min-width: 0; max-width: 100%; font-size: 13px; font-weight: 500; }
.model3d-download-row select { width: 100%; min-width: 0; font-weight: 400; }
.model3d-downloads .model3d-small { margin: 10px 0; max-width: 72ch; }
.model3d-import-steps { margin: 8px 0 16px; padding-left: 20px; font-size: 13px; line-height: 1.8; color: #475569; }
.model3d-import-steps li { padding: 3px 0; }
.model3d-import-steps strong { margin-right: 8px; font-weight: 500; color: #334155; }
.model3d-request-details { margin-top: 20px; border-top: 1px solid var(--model3d-line); }
.model3d-request-details summary, .model3d-help summary { cursor: pointer; padding: 14px 0; font-size: 13px; font-weight: 500; }
.model3d-request-body { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; padding: 4px 0 8px; }
.model3d-result-image { max-height: 160px; width: 100%; object-fit: contain; border-radius: 6px; background: #f8fafc; }
.model3d-request { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; max-width: 72ch; margin: 0; }
.model3d-history-actions { margin: 8px 0 20px; }
.model3d-history-actions .model3d-delete { margin-left: auto; color: #64748b; }
.model3d-history-actions .model3d-delete:hover { color: #b91c1c; }
.model3d-help { border-top: 1px solid var(--model3d-line); }
.model3d-download-guide { border-top: 0; }
.model3d-download-guide summary { padding: 6px 0 10px; color: #466387; }
.model3d-help-body { max-width: 72ch; font-size: 13px; line-height: 1.8; color: #475569; overflow-wrap: anywhere; padding-bottom: 12px; }
.model3d-help-body p { margin: 0 0 12px; }
.model3d-help-body ol { padding-left: 22px; margin: 0 0 14px; }
.model3d-help-body a { color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; }
.model3d-help-body fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.model3d-feedback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.model3d-help-body label { display: block; font-weight: 500; margin: 12px 0; }
.model3d-help-body input, .model3d-help-body textarea { display: block; width: 100%; min-width: 0; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--model3d-line); border-radius: 8px; color: #334155; background: #fff; font: inherit; font-weight: 400; }
.model3d-help-body textarea { resize: vertical; }
.model3d-help-body select { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; }
.model3d-help-body fieldset:disabled { opacity: .65; }
@media (max-width: 640px) {
  .model3d-panel, .model3d-panel.has-result { padding: 24px 16px 32px; }
  .model3d-header { gap: 12px; margin-bottom: 20px; }
  .model3d-header h1 { font-size: 21px; }
  .model3d-header [data-mode] { max-width: 116px; }
  .model3d-intro { font-size: 13px; }
  .model3d-form { padding: 16px; border-radius: 12px; }
  .model3d-upload .model3d-upload-target { min-height: 166px; padding: 18px 10px; }
  .model3d-upload img { max-height: 180px; }
  .model3d-upload-empty strong { font-size: 14px; }
  .model3d-upload-empty > span { font-size: 11px; }
  .model3d-model-field, .model3d-model-field select { width: 100%; max-width: none; }
  .model3d-submit { width: 100%; justify-content: space-between; }
  .model3d-submit [data-price] { text-align: left; flex: 1; }
  .model3d-viewer { height: 43vh; min-height: 260px; }
  .model3d-orbit-hint { display: none; }
  .model3d-viewer-footer { align-items: flex-start; }
  .model3d-view-controls { gap: 4px; }
  .model3d-request-body { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .model3d-result-image { width: auto; max-width: 100%; max-height: 180px; }
  .model3d-feedback-grid { grid-template-columns: minmax(0, 1fr); }
  .model3d-download-row label { flex: 1 1 100%; }
  .model3d-history-actions { align-items: stretch; }
  .model3d-history-actions > button:first-child { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .model3d-panel button, .model3d-panel select { transition: none; } }

.model3d-code-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }
.model3d-code-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.model3d-code-body { overflow: auto; max-height: 65vh; min-height: 180px; margin: 0; padding: 18px; border: 1px solid var(--model3d-line); border-radius: 8px; background: #f8fafc; color: #243247; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre; }
.model3d-code-body code { font: inherit; }
.model3d-code-warning { margin: 16px 0; color: #854d0e; background: #fffbeb; border: 1px solid #f0d795; padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.75; }
.model3d-load-command { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 12px; background: #f8fafc; border-radius: 6px; }
.model3d-code-guide { margin: 0 0 12px; border: 0; }
.model3d-code-guide summary { color: var(--model3d-blue); width: fit-content; padding: 4px 0 8px; }
@media (max-width: 640px) {
  .model3d-code-toolbar { align-items: flex-start; }
  .model3d-code-actions { width: 100%; }
  .model3d-code-body { padding: 12px; font-size: 11px; }
}

.model3d-upload #model3d-upload-help { color: var(--model3d-muted); font-size: 12px; line-height: 1.7; }
.model3d-image-list { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 16px 0; }
.model3d-image-item { flex: 1 1 150px; min-width: 0; max-width: calc((100% - 24px) / 3); }
.model3d-image-item img { width: 100%; height: 140px; object-fit: contain; background: #fff; }
.model3d-image-actions { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; }
.model3d-image-actions button { min-height: 32px; min-width: 32px; padding: 4px 7px; font-size: 12px; }
.model3d-result-images { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.model3d-result-images img { width: 100%; }
@media (max-width: 640px) {
  .model3d-image-list { gap: 10px; padding: 12px 12px 0; }
  .model3d-image-item { flex: 1 1 120px; max-width: calc((100% - 10px) / 2); }
  .model3d-image-item img { height: 110px; }
  .model3d-result-images img { width: calc((100% - 10px) / 2); }
}
