/* ==========================================================================
   Submit group: publish wizard, edit page, translations, STL configuration,
   download pages, payment pages, comment, share pop-up, print page.
   Loaded after css/threedoo.css on every page, so every class here is prefixed
   (sub-, stepper, licence-, pay-, dl-, cfg-, stl-, tr-, share-, lang-card, choice).
   ========================================================================== */

/* STEPPER ------------------------------------------------------------------ */
.stepper { margin: 8px 0 28px; }
.stepper ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; counter-reset: none; }
.stepper li { position: relative; min-width: 0; }
.stepper li::before { content: ""; position: absolute; top: 18px; left: calc(50% + 22px); right: calc(-50% + 22px); height: 2px; background: var(--line-2); }
.stepper li:last-child::before { display: none; }
.stepper li.is-done::before { background: var(--blue); }
.stepper a, .stepper__in { display: grid; justify-items: center; gap: 8px; text-align: center; text-decoration: none; color: var(--ink-3); padding: 4px 2px; border-radius: var(--r-s); }
.stepper a:hover { color: var(--ink); }
.stepper__n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--ink-3); position: relative; z-index: 1; }
.stepper__t { font-weight: 600; font-size: .92rem; line-height: 1.2; overflow-wrap: anywhere; }
.stepper li.is-done .stepper__n { background: var(--blue); border-color: var(--blue); color: #fff; }
.stepper li.is-done .stepper__t { color: var(--ink-2); }
.stepper li.is-current .stepper__n { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 0 0 5px rgba(20, 23, 26, .12); }
.stepper li.is-current .stepper__t { color: var(--ink); }
.stepper__now { display: none; margin: 12px 0 0; font-weight: 600; color: var(--ink-2); }
@media (max-width: 640px) {
	.stepper__t { display: none; }
	.stepper li.is-current .stepper__t { display: none; }
	.stepper__now { display: block; }
	.stepper li::before { top: 18px; }
}
.stepper--flow { max-width: 560px; }

/* LAYOUT ------------------------------------------------------------------- */
.sub-main { max-width: 760px; }
.sub-main--wide { max-width: 960px; }
.sub-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 820px) { .sub-layout { grid-template-columns: 1fr; } }
.sub-aside h2, .sub-main .card > h2, .sub-layout .card > h2 { margin-top: 0; font-size: 1.35rem; }
.sub-subhead { font-size: 1.05rem; margin: 24px 0 8px; }
.sub-help { color: var(--ink-3); font-size: .92rem; margin: 6px 0 0; max-width: 70ch; }
.sub-main .card > .sub-help:first-of-type { margin-top: -4px; margin-bottom: 16px; }
.sub-error { color: #a93a29; font-weight: 600; font-size: .95rem; margin: 6px 0 0; }
.sub-error::before { content: "! "; font-weight: 800; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 0; }
.sub-actions--end { justify-content: flex-end; margin-bottom: 8px; }
.sub-actions--end .sub-help { margin: 0; flex: 1 1 260px; text-align: right; }
.sub-actions--between { justify-content: space-between; }
.sub-actions__next { display: inline-flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; }
.btn-back svg { transform: rotate(180deg); }
.sub-notice { margin: 0 auto; padding-top: 16px; }
.sub-notice h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); }
.sub-checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.sub-checks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.sub-checks svg { color: var(--blue); margin-top: 3px; }
.sub-howto { margin: 0 0 18px; padding-left: 1.3em; max-width: 70ch; }
.sub-howto li { margin-bottom: 6px; }

/* FORMS -------------------------------------------------------------------- */
.sub-form .form-group { margin-bottom: 22px; }
.sub-form--inline { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
.sub-form--inline .sub-actions { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 640px) { .sub-form--inline { grid-template-columns: 1fr; } }
.sub-form .has-error .form-control { border-color: var(--red); box-shadow: 0 0 0 3px rgba(201, 74, 55, .14); }
.sub-form .has-error label { color: var(--ink); }
select.form-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 8px 0; margin: 0; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.check-list { list-style: none; margin: 0 0 12px; padding: 0; }
.check-list small { color: var(--ink-3); }
.sub-choice { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.sub-choice > legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.sub-choice > legend + * { clear: both; }
.choice { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; padding: 14px 16px; margin: 0 0 10px; border: 1.5px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); cursor: pointer; font-weight: 400; transition: border-color .15s, background-color .15s; }
.choice:hover { border-color: var(--ink-3); }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; }
.choice:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue-logo) 7%, var(--surface)); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice__body { display: grid; gap: 4px; }
.choice__body span { color: var(--ink-2); font-size: .95rem; }
.inline-form { display: inline; margin: 0; }

/* START PAGE: language cards ---------------------------------------------- */
.lang-cards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 420px) { .lang-cards { grid-template-columns: 1fr; } }
.lang-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; min-height: 64px; padding: 12px 16px; border: 1.5px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; transition: border-color .15s, transform .2s var(--ease), box-shadow .2s; }
.lang-card:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.lang-card__code { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: #fff; font-size: .85rem; letter-spacing: .04em; }
.lang-card svg { color: var(--ink-3); }

/* 3D VIEWER (renderer ids stay #threedoo-rendering and #threedoo-button) --- */
.render-size { width: 100%; min-width: 0; max-width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-m); background: #fff; overflow: hidden; min-height: 240px; }
#threedoo-rendering { max-width: 100%; }
#threedoo-rendering canvas { display: block; max-width: 100%; }
.render-tools, #threedoo-button { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
#threedoo-button .btn { min-height: 44px; }
#threedoo-button .btn:not(.btn-primary):not(.btn-success) { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
#threedoo-button .next-step { order: -1; }
#threedoo-button label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-weight: 500; }
#threedoo-button select.btn { padding: 0 36px 0 14px; text-align: left; }
#threedoo-button br { display: none; }
.shot-preview { margin-top: 12px; }
.shot-preview > div { font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.shot-preview img, #screenshot-preview > img { max-width: 220px; border: 1px solid var(--line); border-radius: var(--r-s); margin: 0 8px 8px 0; background: #fff; }

/* FILE LIST (filled by js/loader/designDataList.js) ------------------------ */
.file-list { overflow-x: auto; }
.file-list:empty::before { content: "-"; color: var(--ink-3); }
.file-list table { margin: 0; }
.file-list img { max-height: 48px; border-radius: 6px; }
.file-list .btn { min-height: 36px; min-width: 36px; padding: 0 10px; }
.sub-formats { margin-top: 20px; }
.sub-formats summary { cursor: pointer; font-weight: 600; color: var(--ink-2); min-height: 44px; display: flex; align-items: center; }
.sub-formats dl { display: grid; gap: 8px; margin: 8px 0 0; }
.sub-formats dl > div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; }
.sub-formats dt { font-weight: 600; }
.sub-formats dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 520px) { .sub-formats dl > div { grid-template-columns: 1fr; gap: 0; } }

/* PRINT SETTINGS, LINKS, PARTS -------------------------------------------- */
.stl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.stl-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--ground); }
.stl-row__img { width: 96px; height: 72px; object-fit: contain; background: #fff; border-radius: var(--r-s); border: 1px solid var(--line); }
.stl-row__img--empty { display: block; }
.stl-row h3 { margin: 0 0 10px; font-size: 1.1rem; overflow-wrap: anywhere; }
.stl-row h3 small { color: var(--ink-3); font-size: .8rem; }
@media (max-width: 520px) { .stl-row { grid-template-columns: 1fr; } }
.cfg-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.cfg { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); }
.cfg-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; margin: 0 0 8px; }
.cfg-facts dt { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.cfg-facts dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.cfg-desc { margin: 0 0 8px; color: var(--ink-2); }
.cfg__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-delete { color: var(--red); border-color: #e3b5ac; }
.btn-delete:hover { background: #f9dcd6; color: #8a2a1b; border-color: var(--red); }
.row-list { list-style: none; margin: 0 0 20px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.row-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--surface); }
.row-list li + li { border-top: 1px solid var(--line); }
.row-list li > div { display: grid; min-width: 0; }
.row-list small { color: var(--ink-3); overflow-wrap: anywhere; }
.cfg-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.cfg-head h2 { margin: 0; overflow-wrap: anywhere; }
.cfg-head__img { max-height: 80px; border-radius: var(--r-s); border: 1px solid var(--line); background: #fff; }
.cfg-form .form-horizontal .form-group { margin-left: 0; margin-right: 0; }
.cfg-form .control-label { text-align: left; }
.cfg-form form { margin: 0; }
.cfg-form select, .cfg-form input[type="text"], .cfg-form input[type="number"] { max-width: 100%; }

/* DONE --------------------------------------------------------------------- */
.sub-done { text-align: center; padding-top: 36px; padding-bottom: 36px; }
.sub-done h2 { margin-top: 12px; overflow-wrap: anywhere; }
.sub-done p { margin-left: auto; margin-right: auto; }
.sub-done .sub-actions { justify-content: center; }
.sub-done__icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--blue); color: #fff; }

/* EDIT PAGE ---------------------------------------------------------------- */
.sub-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.sub-jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line-2); color: var(--ink); font-weight: 600; text-decoration: none; }
.sub-jump a:hover { border-color: var(--ink); }
.sub-main .card[id], .sub-main form.card[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* TRANSLATIONS ------------------------------------------------------------- */
.tr-group { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; margin: 0 0 20px; min-width: 0; }
.tr-group > legend { float: left; width: 100%; padding: 0; margin: 0 0 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.tr-group > legend + * { clear: both; }
.tr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .tr-grid { grid-template-columns: 1fr; } }

/* DOWNLOAD: licence choice ------------------------------------------------- */
.dl-head { display: flex; gap: 20px; align-items: center; }
.dl-head__img { width: 160px; height: 120px; object-fit: cover; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); flex: none; }
@media (max-width: 520px) { .dl-head { flex-direction: column; align-items: flex-start; } }
.licence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 16px 0 8px; align-items: stretch; }
@media (max-width: 760px) { .licence-grid { grid-template-columns: 1fr; } }
.licence-card { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--blue-logo) 55%, var(--surface)); border-radius: var(--r-l); padding: clamp(18px, 3vw, 28px); }
.licence-card--paid { border-color: color-mix(in srgb, var(--orange) 70%, var(--surface)); }
.licence-card--off { border-color: var(--line); color: var(--ink-2); }
.licence-card header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.licence-card h2 { margin: 0; font-size: 1.4rem; }
.licence-card h2 small { margin-left: 4px; }
.licence-card__price { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.licence-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; align-content: start; }
.licence-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.licence-list svg { margin-top: 3px; color: var(--blue); }
.licence-card--paid .licence-list svg { color: var(--orange); }
.licence-card .btn { align-self: flex-start; }
.licence-card .btn svg { margin-right: 2px; }
.dl-more { margin-top: 8px; }
.dl-form { margin-top: 20px; }
.dl-form fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.dl-form legend { font-size: 1.2rem; margin-bottom: 8px; }

/* PAYMENT ------------------------------------------------------------------ */
.pay-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 8px; }
@media (max-width: 820px) { .pay-layout { grid-template-columns: 1fr; } .pay-layout .pay-box { order: -1; } }
.pay-layout .card h2 { margin-top: 0; font-size: 1.35rem; }
.pay-box { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 14px; }
@media (max-width: 820px) { .pay-box { position: static; } }
.pay-design { display: flex; gap: 14px; align-items: center; margin: 0; }
.pay-design img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); flex: none; }
.pay-design strong { overflow-wrap: anywhere; }
.pay-sum { margin: 0; display: grid; gap: 8px; }
.pay-sum > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pay-sum dt { color: var(--ink-3); font-weight: 600; }
.pay-sum dd { margin: 0; font-weight: 600; }
.pay-sum__total { border-bottom: 0 !important; }
.pay-sum__total dt { color: var(--ink); }
.pay-sum__total dd { font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; }
.pay-methods { display: grid; gap: 16px; }
.card--off { background: var(--ground); color: var(--ink-3); }
.card--off h2 { color: var(--ink-3); }
.pay-box .btn, .pay-methods .btn-lg { width: 100%; }
.pay-methods .sub-actions .btn { width: auto; }

/* SHARE POP-UP (bare shell) ------------------------------------------------ */
.share-page { max-width: 760px; padding-bottom: 32px; }
.share-block h2 { margin-top: 0; font-size: 1.3rem; }
.share-lic { margin-left: 6px; }
.share-preview { padding: 12px; margin-bottom: 14px; background: var(--ground); border-radius: var(--r-s); overflow: auto; }
.share-block textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; margin-bottom: 10px; }
@media (max-width: 640px) { .stepper--flow .stepper__t { display: block; font-size: .8rem; } }
