/* ═══ 3D-перегляд візитки ═══ */
.sv-3d { padding-block: 20px 56px; }
.c3d-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; margin-top: 30px; align-items: stretch; }
.c3d-stage { position: relative; min-height: 380px; border-radius: 20px; border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 30%, #ffffff 0%, #eef0e8 70%); overflow: hidden; }
.c3d-stage.is-over { outline: 2px dashed var(--green); outline-offset: -8px; }
.c3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; outline: none; }
.c3d-stage.is-drag canvas { cursor: grabbing; }
.c3d-stage canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--green); border-radius: 20px; }
.c3d:not(.c3d-ready) .c3d-stage canvas { opacity: 0; }
.c3d-stage canvas { transition: opacity .4s; }
.c3d-faces { position: absolute; left: 14px; top: 14px; display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgb(255 255 255 / 78%); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.c3d-faces button { border: 0; background: none; padding: 8px 16px; border-radius: 999px; font: 600 12px/1 Montserrat, sans-serif; color: var(--muted); cursor: pointer; }
.c3d-faces button[aria-pressed="true"] { background: var(--green); color: #fff; }
.c3d-faces button:focus-visible, .c3d-lam button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.c3d-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px; background: rgb(0 0 0 / 55%); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.c3d-touched .c3d-hint { opacity: 0; }
.c3d-busy .c3d-stage::after { content: ""; position: absolute; right: 16px; top: 16px; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--green); border-right-color: transparent; animation: c3d-spin .8s linear infinite; }
@keyframes c3d-spin { to { transform: rotate(360deg); } }
.c3d-fallback { display: none; position: absolute; inset: 0; padding: 28px; align-content: center; justify-items: center; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }
.c3d-nogl .c3d-fallback { display: grid; }
.c3d-nogl canvas, .c3d-nogl .c3d-faces, .c3d-nogl .c3d-hint { display: none; }
.c3d-panel { display: grid; gap: 14px; align-content: start; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #faf9f3; }
.c3d-panel h3 { margin: 0; font: 600 16px/1.3 Unbounded, sans-serif; letter-spacing: -0.03em; }
.c3d-drop { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px; border: 1.5px dashed #c4c4b4; border-radius: 14px; background: rgb(255 255 255 / 55%); cursor: pointer; transition: border-color .2s, background .2s; }
.c3d-drop:hover, .c3d-drop.is-over, .c3d-drop:focus-within { border-color: var(--green); background: rgb(51 131 9 / 6%); }
.c3d-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.c3d-drop .ic-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #eaf1e3; color: var(--green); }
.c3d-drop .ic-box svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.c3d-drop b { display: block; font-size: 14px; font-weight: 600; }
.c3d-drop small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.c3d-drop.has-file { border-style: solid; border-color: var(--green); }
.c3d-drop.has-file .ic-box { background: var(--green); color: #fff; }
.c3d-drop [data-c3d-clear] { position: relative; z-index: 1; border: 0; background: none; color: var(--muted); font: 600 12px Montserrat, sans-serif; padding: 6px 8px; border-radius: 8px; cursor: pointer; text-decoration: underline; }
.c3d-drop [data-c3d-clear]:hover { color: #c0392b; }
.c3d-lam { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: #eceade; width: fit-content; }
.c3d-lam button { border: 0; background: none; padding: 9px 18px; border-radius: 999px; font: 600 13px/1 Montserrat, sans-serif; color: var(--muted); cursor: pointer; }
.c3d-lam button[aria-pressed="true"] { background: #fff; color: #20251c; box-shadow: 0 1px 4px rgb(0 0 0 / 14%); }
.c3d-label { margin: 2px 0 -6px; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.c3d-msg { margin: 0; min-height: 20px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.c3d-msg[data-bad="1"] { color: #c0392b; }
.c3d-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.c3d-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) {
  .c3d-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  /* без aspect-ratio: у Safari на iPhone такий блок у гріді схлопувався до 0 px */
  .c3d-stage { min-height: 0; height: clamp(260px, 82vw, 480px); }
  .c3d-panel { padding: 18px 16px; }
  .c3d-hint { font-size: 11px; }
  .sv-3d { padding-bottom: 36px; }
}
html[data-theme="dark"] .c3d-stage { background: radial-gradient(ellipse at 50% 30%, #2a2e27 0%, #171916 72%); }
html[data-theme="dark"] .c3d-faces { background: rgb(28 31 27 / 80%); }
html[data-theme="dark"] .c3d-panel { background: #1c1f1b; }
html[data-theme="dark"] .c3d-drop { background: rgb(255 255 255 / 3%); border-color: #41463e; }
html[data-theme="dark"] .c3d-drop .ic-box { background: #262b22; color: var(--green-text); }
html[data-theme="dark"] .c3d-lam { background: #262a24; }
html[data-theme="dark"] .c3d-lam button[aria-pressed="true"] { background: #3a4036; color: #fff; }
html[data-theme="dark"] .c3d-drop.has-file .ic-box { background: var(--green); color: #fff; }
@media (prefers-reduced-motion: reduce) { .c3d-stage canvas, .c3d-hint { transition: none; } .c3d-busy .c3d-stage::after { animation-duration: 2s; } }
.c3d-h-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .c3d-h-mouse { display: none; } .c3d-h-touch { display: inline; } }
@media (max-width: 420px) { .c3d-hint { max-width: calc(100% - 24px); white-space: normal; text-align: center; } }
.c3d-why { display: block; margin-top: 10px; font-size: 11px; opacity: .75; word-break: break-word; }
