/* Dental Model Prep. Scoped under .dqmp so it sits inside any theme. */

.dqmp {
  --dq-accent: #1f5f7a;
  --dq-accent-soft: #e7f0f4;
  --dq-ink: #23282d;
  --dq-muted: #5d666e;
  --dq-line: #dfe4e7;
  --dq-paper: #ffffff;
  --dq-bg: #f7f5f1;
  --dq-warn: #8a6116;
  --dq-warn-soft: #fbf5e8;
  --dq-bad: #8a2424;
  color: var(--dq-ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--dq-bg);
  border-radius: 10px;
  padding: 18px;
  box-sizing: border-box;
}
.dqmp *, .dqmp *::before, .dqmp *::after { box-sizing: inherit; }
.dqmp [hidden] { display: none !important; }

.dqmp-intro p { margin: 0 0 6px; color: var(--dq-muted); }
.dqmp-intro strong { color: var(--dq-ink); font-weight: 600; }
.dqmp-demo { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--dq-warn-soft); color: var(--dq-warn) !important; font-size: 13px; }

/* Scans, name and settings in a row across the top; the preview and the
   model cards on the level below; the credits block under that. */
.dqmp-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 12px; }
.dqmp-side { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(0, 4fr); gap: 12px 18px; align-items: stretch; }
/* Settings in two columns: the everyday settings, and the advanced ones. */
.dqmp-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-content: start; }
.dqmp-settings > h3 { grid-column: 1 / -1; }
.dqmp-advanced summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--dq-accent); margin: 0 0 10px; }
@media (max-width: 860px) { .dqmp-settings { grid-template-columns: 1fr; } }
.dqmp-side > .dqmp-card { margin-bottom: 0; }
.dqmp-side > .dqmp-process, .dqmp-side > .dqmp-progress { grid-column: 1 / -1; width: 50%; justify-self: center; }
.dqmp-side > .dqmp-progress { margin-top: -4px; }
@media (max-width: 860px) { .dqmp-side { grid-template-columns: 1fr; } }

.dqmp-card { background: var(--dq-paper); border: 1px solid var(--dq-line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.dqmp-card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }

.dqmp-files { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.dqmp-file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; padding: 3px 0; }
.dqmp-file-jaw { font-weight: 600; }
.dqmp-file-name { color: var(--dq-muted); overflow-wrap: anywhere; }
.dqmp-file .dqmp-link, .dqmp-swap-row .dqmp-link { padding: 0; }
.dqmp-swap-row { margin: 4px 0 0; }
.dqmp-drop { display: block; border: 1.5px dashed #b9c6cd; border-radius: 8px; padding: 12px; cursor: pointer; background: #fbfcfc; transition: border-color .15s, background .15s; }
.dqmp-drop:hover, .dqmp-drop.over { border-color: var(--dq-accent); background: var(--dq-accent-soft); }
.dqmp-drop.has { border-style: solid; border-color: var(--dq-accent); background: var(--dq-accent-soft); }
.dqmp-drop-title { display: block; font-weight: 600; }
.dqmp-drop-file { display: block; font-size: 13px; color: var(--dq-muted); overflow-wrap: anywhere; }
.dqmp-slot-note { margin: 6px 0 0; font-size: 13px; color: var(--dq-warn); }
.dqmp-link { background: none; border: 0; padding: 4px 0 0; color: var(--dq-bad); font-size: 13px; text-decoration: underline; cursor: pointer; }

.dqmp-name { width: 100%; font-size: 16px; padding: 8px 10px; border: 1px solid #c3cfd6; border-radius: 6px; }
.dqmp-name:focus, .dqmp select:focus { outline: 2px solid var(--dq-accent); outline-offset: 1px; }
.dqmp-hint { margin: 6px 0 0; font-size: 13px; color: var(--dq-muted); }

.dqmp-field { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin: 0 0 8px; }
.dqmp-field select { min-width: 150px; max-width: 60%; padding: 5px 6px; border: 1px solid #c3cfd6; border-radius: 6px; background: #fff; font-size: 14px; }

.dqmp-btn { display: inline-block; width: 100%; padding: 11px 14px; border: 0; border-radius: 8px; background: var(--dq-accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.dqmp-btn:hover:not(:disabled) { background: #184d63; }
.dqmp-btn:disabled { background: #a9bcc5; cursor: not-allowed; }
@keyframes dqmp-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(31, 95, 122, 0); } 50% { box-shadow: 0 0 0 8px rgba(31, 95, 122, 0.35); background: #2a7ba0; } }
.dqmp-process.dqmp-flash { animation: dqmp-flash 0.6s ease-in-out 3; }

.dqmp-progress { margin-top: 10px; }
.dqmp-bar { height: 6px; border-radius: 3px; background: var(--dq-line); overflow: hidden; }
.dqmp-bar span { display: block; height: 100%; width: 0; background: var(--dq-accent); transition: width .2s; }
.dqmp-progress-text { margin: 6px 0 0; font-size: 13px; color: var(--dq-muted); }

/* The preview with the model cards beside it; the trim bar and the
   disclaimer run under both. */
.dqmp-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 52fr) minmax(240px, 48fr); grid-template-areas: "toolbar toolbar" "stage results" "trim trim" "note note"; gap: 0 16px; align-items: start; }
.dqmp-toolbar { grid-area: toolbar; }
.dqmp-stage { grid-area: stage; }
.dqmp-results { grid-area: results; }
.dqmp-trimbar { grid-area: trim; }
.dqmp-disclaimer { grid-area: note; }
@media (max-width: 860px) { .dqmp-main { grid-template-columns: 1fr; grid-template-areas: "toolbar" "stage" "trim" "results" "note"; } }
.dqmp-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 34px; margin-bottom: 8px; }
.dqmp-seg { display: inline-flex; border: 1px solid var(--dq-line); border-radius: 8px; overflow: hidden; background: #fff; }
.dqmp-seg:empty { display: none; }
.dqmp-seg button { border: 0; background: none; padding: 6px 14px; font-size: 14px; cursor: pointer; color: var(--dq-muted); }
.dqmp-seg button.on { background: var(--dq-accent); color: #fff; }
.dqmp-cut { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dq-muted); }
.dqmp-cut input[type=range] { width: 140px; }

.dqmp-stage { position: relative; height: 620px; border-radius: 10px; border: 1px solid var(--dq-line); background: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #eef0f0 70%, #e6e9ea 100%); overflow: hidden; }
@media (max-width: 860px) { .dqmp-stage { height: 340px; } }
.dqmp-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.dqmp-canvas:active { cursor: grabbing; }
.dqmp-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px; text-align: center; color: var(--dq-muted); pointer-events: none; }
.dqmp-help { position: absolute; left: 12px; bottom: 8px; margin: 0; font-size: 12px; color: #7c858c; pointer-events: none; }

.dqmp-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 0; align-items: stretch; }
.dqmp-results:empty { display: none; }
@media (max-width: 860px) { .dqmp-results { margin-top: 12px; } }
@media (max-width: 560px) { .dqmp-results { grid-template-columns: 1fr; } }
.dqmp-result { background: #fff; border: 1px solid var(--dq-line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; }
.dqmp-result .dqmp-btn { margin-top: auto; }
.dqmp-result.error { border-color: #e2b7b7; background: #fdf4f4; }
.dqmp-result h4 { margin: 0 0 8px; font-size: 15px; }
.dqmp-facts { list-style: none; margin: 0 0 10px; padding: 0; font-size: 14px; }
.dqmp-facts li { padding: 2px 0; }
.dqmp-warnings { margin: 0 0 10px; padding: 8px 10px 8px 26px; background: var(--dq-warn-soft); border-radius: 6px; font-size: 13px; color: #5c4210; }
.dqmp-warnings li + li { margin-top: 4px; }
.dqmp-stale { margin: 6px 0 0; font-size: 13px; color: var(--dq-warn); }
.dqmp-balance { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--dq-muted); }
.dqmp-disclaimer { margin: 14px 0 0; font-size: 13px; color: var(--dq-muted); }
.dqmp-disclaimer a { color: var(--dq-accent); }

/* Upper / lower switch, on the preview itself */
.dqmp-stage .dqmp-jaws { position: absolute; top: 10px; left: 10px; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* Trim-line tools, on the preview, only while the trim line is shown */
.dqmp-stage .dqmp-trimtools { position: absolute; top: 50px; left: 10px; z-index: 2; display: flex; gap: 6px; }
.dqmp-trimtools button { padding: 6px 12px; border: 1px solid var(--dq-line); border-radius: 8px; background: #fff; color: var(--dq-accent); font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.dqmp-trimtools button:hover { background: var(--dq-accent-soft); }
/* Recalculate models, top right of the preview, while a trim line has changed */
.dqmp-stage .dqmp-recalc { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--dq-accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.dqmp-stage .dqmp-recalc:hover { background: #184d63; }
.dqmp-recalc.dqmp-flashing { animation: dqmp-flash 1.2s ease-in-out infinite; }
.dqmp-stage .dqmp-band { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.dqmp-band line { stroke: #db731a; stroke-width: 2; stroke-dasharray: 6 4; }
.dqmp-seg button:disabled { opacity: .45; cursor: not-allowed; }

/* Moving the trim line */
.dqmp-trimbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--dq-line); border-radius: 10px; background: #fff; }
.dqmp-trimbar p { margin: 0; font-size: 13px; }
.dqmp-trim-text { flex: 1 1 320px; color: var(--dq-muted); }
.dqmp-trim-read { flex: 1 1 100%; order: 3; min-height: 1.3em; font-weight: 600; }
.dqmp-trim-actions { display: flex; gap: 12px; align-items: center; }
.dqmp-trim-actions .dqmp-btn { width: auto; padding: 8px 16px; margin: 0; }
.dqmp-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #9aa; vertical-align: -1px; margin: 0 4px 0 2px; }
.dqmp-key.b { background: #1f5f7a; } .dqmp-key.l { background: #734794; } .dqmp-key.a { background: #595e66; } .dqmp-key.m { background: #db731a; }

.dqmp-both { grid-column: 1 / -1; }

/* Credits next to the tool page's title */
.dqmp-title-credits { display: inline-block; vertical-align: middle; margin-left: .6em; padding: .25em .7em; border-radius: 999px; background: #eef4f7; color: #1f5f7a; font-size: 16px; font-weight: 400; line-height: 1.4; letter-spacing: 0; white-space: nowrap; }
.dqmp-title-credits strong { font-weight: 700; }

/* Credit products and the coupon box: a block under the tool, side by side */
.dqmp-buy-block { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.dqmp-buy-block > .widget { margin: 0; padding: 14px 16px; border: 1px solid #dfe3e6; border-radius: 8px; background: #fff; }
.dqmp-buy-block .widget-title { font-size: 16px; margin: 0 0 .6em; }
@media (max-width: 860px) { .dqmp-buy-block { grid-template-columns: 1fr; } }
.dqmp-buy { font-size: 15px; }
.dqmp-buy-have { margin: 0 0 .8em; }
.dqmp-buy-list { list-style: none; margin: 0 0 .6em; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.dqmp-buy-list li { display: flex; flex-direction: column; align-items: flex-start; gap: .5em; padding: .7em .8em; border: 1px solid #e3e6e8; border-radius: 8px; background: #fbfcfc; }
.dqmp-buy-what { display: flex; flex-direction: column; line-height: 1.35; }
.dqmp-buy-what span { color: #5b6670; font-size: 13px; }
.dqmp-buy-what em { color: #2e7d32; font-style: normal; }
.dqmp-buy a.button.dqmp-buy-btn { flex: none; padding: .45em 1.1em; background: #1f5f7a; border-color: #1f5f7a; color: #fff; border-radius: 6px; }
.dqmp-buy a.button.dqmp-buy-btn:hover, .dqmp-buy a.button.dqmp-buy-btn:focus { background: #174a60; border-color: #174a60; color: #fff; }
.dqmp-buy-note { margin: .4em 0 0; font-size: 13px; color: #5b6670; }

/* The coupon box */
.dqmp-coupon-form { display: flex; gap: .5em; }
.dqmp-coupon-form input { flex: 1; min-width: 0; text-transform: uppercase; }
.dqmp-coupon-form input::placeholder { text-transform: none; }
.dqmp-coupon a.button, .dqmp-coupon button.button { flex: none; background: #1f5f7a; border-color: #1f5f7a; color: #fff; border-radius: 6px; }
.dqmp-coupon button.button:hover, .dqmp-coupon button.button:focus { background: #174a60; border-color: #174a60; color: #fff; }
.dqmp-coupon-msg { margin: .6em 0 0; font-size: 14px; }
.dqmp-coupon-msg.ok { color: #2e7d32; }
.dqmp-coupon-msg.err { color: #b3261e; }

/* Resin price */
.dqmp-money { display: inline-flex; align-items: center; gap: .3em; }
.dqmp-money input { width: 7.5em; padding: 5px 6px; border: 1px solid #c3cfd6; border-radius: 6px; background: #fff; font-size: 14px; }
.dqmp-resin-total { grid-column: 1 / -1; margin: 0; font-size: 15px; text-align: center; }

/* The Subscribe button in the sidebar, above the packages. */
.dqmp-subscribe { margin: 0 0 .8em; }
.dqmp-subscribe a.button.dqmp-buy-btn { display: inline-block; margin: 0 0 .3em; }
.dqmp-subscribe span { display: block; font-size: .9em; color: #4b5563; }
