/* AI Studios — «3D по фото». Олива, тёплый белый текст, хаки только у главной кнопки, золотые уголки рамок. Префикс .m3- */
.m3-root {
  --m3-bg: #121611;
  --m3-panel: #171b14;
  --m3-panel2: #1c2118;
  --m3-line: rgba(214, 190, 128, .18);
  --m3-line2: rgba(239, 236, 226, .12);
  --m3-gold: #d6be80;
  --m3-khaki: #c9b480;
  --m3-text: #efece2;
  --m3-muted: #a7a693;
  --m3-serif: "Playfair Display", Georgia, serif;
  --m3-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --m3-mono: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--m3-text);
  font: 400 15px/1.45 var(--m3-sans);
  max-width: 1240px;
  margin: 0 auto;
  min-width: 0;
}
.m3-root *, .m3-root *::before, .m3-root *::after { box-sizing: border-box; }
.m3-root [hidden] { display: none !important; }
.m3-root button, .m3-root input { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.m3-root :focus-visible { outline: 2px solid var(--m3-gold); outline-offset: 2px; }
.m3-root svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* рамка с золотыми уголками */
.m3-frame, .m3-stage-box, .m3-turn, .m3-viewer, .m3-pick {
  position: relative;
  background: var(--m3-panel);
  border: 1px solid var(--m3-line2);
  border-radius: 6px;
}
.m3-frame::before, .m3-frame::after, .m3-stage-box::before, .m3-stage-box::after,
.m3-turn::before, .m3-turn::after, .m3-viewer::before, .m3-viewer::after, .m3-pick::before, .m3-pick::after {
  content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none; z-index: 2;
}
.m3-frame::before, .m3-stage-box::before, .m3-turn::before, .m3-viewer::before, .m3-pick::before { top: -1px; left: -1px; border-top: 1px solid var(--m3-gold); border-left: 1px solid var(--m3-gold); }
.m3-frame::after, .m3-stage-box::after, .m3-turn::after, .m3-viewer::after, .m3-pick::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--m3-gold); border-right: 1px solid var(--m3-gold); }
.m3-frame { padding: 28px; background: var(--m3-bg); }

.m3-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.m3-ico { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--m3-line); border-radius: 50%; color: var(--m3-gold); flex: none; }
.m3-title { font: 600 28px/1.15 var(--m3-serif); margin: 0 0 4px; letter-spacing: .01em; }
.m3-sub { margin: 0; color: var(--m3-muted); }
.m3-h { font: 500 12px/1.3 var(--m3-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--m3-gold); margin: 0 0 8px; }
.m3-note { color: var(--m3-muted); font-size: 13px; margin: 6px 0; }

.m3-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; }
.m3-col { min-width: 0; }

.m3-tiles { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.m3-tile { flex: none; width: 96px; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 4px; border: 1px solid var(--m3-line2); border-radius: 6px; background: var(--m3-panel); cursor: pointer; font-size: 12px; color: var(--m3-muted); text-align: center; }
.m3-tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #0c0e0a; border-radius: 4px; display: block; }
.m3-tile span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m3-tile.is-on { border-color: var(--m3-gold); color: var(--m3-text); }
.m3-up { position: relative; overflow: hidden; justify-content: center; min-height: 140px; border-style: dashed; }
.m3-up input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.m3-pick { margin-top: 12px; height: 220px; display: grid; place-items: center; overflow: hidden; color: var(--m3-muted); }
.m3-pick img { width: 100%; height: 100%; object-fit: contain; display: block; }

.m3-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.m3-mode { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px; border: 1px solid var(--m3-line2); border-radius: 6px; background: var(--m3-panel); cursor: pointer; }
.m3-mode b { font-weight: 600; }
.m3-mode small { color: var(--m3-muted); font-size: 12.5px; }
.m3-mode.is-on { border-color: var(--m3-gold); background: var(--m3-panel2); box-shadow: inset 0 0 0 1px rgba(214, 190, 128, .25); }

.m3-more { border-top: 1px solid var(--m3-line2); border-bottom: 1px solid var(--m3-line2); padding: 10px 0; margin: 4px 0 10px; }
.m3-more summary { cursor: pointer; color: var(--m3-muted); font-size: 13px; }
.m3-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.m3-row input { width: 140px; padding: 8px 10px; background: #0d100b; border: 1px solid var(--m3-line2); border-radius: 4px; font-family: var(--m3-mono); }
.m3-check { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 14px; }
.m3-check input { accent-color: var(--m3-gold); width: 16px; height: 16px; }

.m3-go, .m3-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 4px; cursor: pointer; text-decoration: none; font-weight: 600; }
.m3-go { width: 100%; margin-top: 8px; background: var(--m3-khaki); color: #15180f; border: 0; }
.m3-root .m3-go:not(:disabled) { color: #15180f; } /* О16: общий button{color:inherit} перебивал тёмный текст — контраст был 1.7 */
.m3-go:disabled { background: #2a2f24; color: var(--m3-muted); cursor: not-allowed; }
.m3-btn { background: transparent; color: var(--m3-text); border: 1px solid var(--m3-line2); font-weight: 500; }
.m3-btn:hover { border-color: var(--m3-gold); }
.m3-btn:disabled { color: var(--m3-gold); border-color: var(--m3-line); cursor: default; }

.m3-msg { margin: 10px 0 0; font-size: 14px; }
.m3-msg.is-err { color: #f0a58f; }
.m3-msg.is-ok { color: var(--m3-gold); }
.m3-msg.is-info { color: var(--m3-muted); }

/* ожидание */
.m3-wait { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.m3-stage-box { height: 420px; overflow: hidden; display: grid; place-items: center; perspective: 900px; background: radial-gradient(ellipse at 50% 70%, #1d2318, #10130e 70%); }
.m3-src { position: absolute; right: 10px; bottom: 10px; width: 72px; height: 96px; object-fit: contain; background: #0c0e0a; border: 1px solid var(--m3-line); border-radius: 4px; z-index: 3; }
.m3-wire { position: relative; width: 150px; height: 260px; transform-style: preserve-3d; }
.m3-wire-in { position: absolute; inset: 0; transform-style: preserve-3d; animation: m3-spin 6s linear infinite; }
.m3-wire i { position: absolute; inset: 0; border: 1px solid rgba(214, 190, 128, .55); border-radius: 50% / 22%; transform: rotateY(var(--r)); }
.m3-wire b { position: absolute; left: 50%; top: calc(50% + var(--y)); width: 150px; height: 150px; margin: -75px 0 0 -75px; border: 1px solid rgba(214, 190, 128, .3); border-radius: 50%; transform: rotateX(90deg); }
.m3-floor { position: absolute; left: 50%; bottom: -40px; width: 240px; height: 240px; margin-left: -120px; border-radius: 50%; background: repeating-radial-gradient(circle, rgba(214, 190, 128, .14) 0 1px, transparent 1px 22px); transform: rotateX(80deg); }
@keyframes m3-spin { to { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) { .m3-wire-in { animation-duration: 30s; } }

.m3-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.m3-steps li { display: flex; align-items: center; gap: 10px; color: var(--m3-muted); }
.m3-steps li i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--m3-line); flex: none; }
.m3-steps li.is-done { color: var(--m3-text); }
.m3-steps li.is-done i { background: var(--m3-gold); border-color: var(--m3-gold); }
.m3-steps li.is-now { color: var(--m3-text); }
.m3-steps li.is-now i { border-color: var(--m3-gold); box-shadow: 0 0 0 3px rgba(214, 190, 128, .18); animation: m3-pulse 1.4s ease-in-out infinite; }
.m3-steps li.is-skip { opacity: .5; }
.m3-steps small { font-size: 12px; }
@keyframes m3-pulse { 50% { box-shadow: 0 0 0 6px rgba(214, 190, 128, .05); } }
.m3-bar { height: 4px; background: var(--m3-line2); border-radius: 2px; overflow: hidden; position: relative; }
.m3-bar i { display: block; height: 100%; width: 0; background: var(--m3-gold); transition: width .6s ease; }
.m3-bar.is-unknown i { width: 30% !important; animation: m3-slide 1.6s ease-in-out infinite; }
@keyframes m3-slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.m3-state { margin: 10px 0 0; font-family: var(--m3-mono); font-size: 13px; color: var(--m3-text); }

/* готово */
.m3-done { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.m3-turn, .m3-viewer { height: 520px; overflow: hidden; display: grid; place-items: center; background: #0d100b; }
.m3-turn video { width: 100%; height: 100%; object-fit: contain; display: block; }
.m3-viewer model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: #0d100b; }
.m3-tag { position: absolute; left: 12px; top: 10px; font: 500 11px/1 var(--m3-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--m3-gold); background: rgba(13, 16, 11, .7); padding: 5px 7px; border-radius: 3px; z-index: 3; }
.m3-viewer .m3-note { padding: 20px; text-align: center; }
.m3-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.m3-facts div { border: 1px solid var(--m3-line2); border-radius: 4px; padding: 10px 12px; }
.m3-facts span { display: block; font-size: 12px; color: var(--m3-muted); }
.m3-facts b { font: 500 16px/1.3 var(--m3-mono); }
.m3-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.m3-acts .m3-go { width: auto; margin: 0; }
.m3-done > .m3-msg { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .m3-frame { padding: 18px 16px; }
  .m3-title { font-size: 23px; }
  .m3-grid, .m3-wait, .m3-done { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .m3-pick { height: 160px; }
  .m3-stage-box { height: 300px; }
  .m3-turn, .m3-viewer { height: 340px; }
  .m3-modes { grid-template-columns: 1fr; }
  .m3-acts > * { flex: 1 1 100%; }
}
/* О16: тапы ≥ 44 на телефоне — галочки и поле граней */
@media (max-width: 760px) { .m3-check { min-height: 44px; } .m3-root input[type=number] { min-height: 44px; } }
