/* MadeMine — design studio */
.studio-body { overflow: hidden; height: 100vh; height: 100dvh; background: #fff; }
.st { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.st-top { height: 60px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid #EDE4DA; background: #fff; z-index: 5; }
.st-home { display: flex; }
.st-name { border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 15px; width: 210px; background: transparent; min-height: 36px; }
.st-name:hover, .st-name:focus { border-color: var(--line-d); background: #fff; outline: none; }
.st-meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.st-tools { display: flex; gap: 2px; }
.st-status { font-size: 12.5px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.st-status.ok { color: var(--green); }
.st-right { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.ib { background: none; border: 0; border-radius: 8px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.ib:hover { background: var(--cream); }
.ib:disabled { opacity: .35; cursor: default; background: none; }
.show-sm { display: none; }

.st-main { flex: 1; display: flex; min-height: 0; }
.st-rail { width: 82px; flex: none; border-inline-end: 1px solid #EDE4DA; padding: 10px 7px; display: flex; flex-direction: column; gap: 4px; background: #fff; overflow-y: auto; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px; font-size: 11px; color: var(--muted); background: none; border: 0; border-radius: 10px; cursor: pointer; line-height: 1.2; }
.rail-btn:hover { color: var(--burg); background: var(--burg-xl); }
.rail-btn.on { color: var(--burg); background: var(--burg-l); font-weight: 600; }

.st-panel { width: 290px; flex: none; border-inline-end: 1px solid #EDE4DA; background: #fff; display: flex; flex-direction: column; min-height: 0; }
.st-panel.closed { display: none; }
.panel-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.panel-h b { font-size: 15px; }
.panel-x { display: none; }
.panel-b { padding: 6px 16px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.p-sub { font-size: 11px; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; text-transform: uppercase; margin-top: 8px; }
[dir="rtl"] .p-sub { letter-spacing: 0; }
.font-it { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer; font-size: 16px; text-align: start; }
.font-it:hover { background: var(--cream); }
.font-it.on { background: var(--burg-l); color: var(--burg); }
.font-it small { color: var(--muted); font-size: 14px; }
.add-btn { justify-content: flex-start; }
.el-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.el-btn { aspect-ratio: 1; border: 1px solid #EDE4DA; border-radius: 10px; background: #FBF8F5; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 10px; }
.el-btn:hover { border-color: var(--burg); background: var(--burg-xl); }
.el-btn img { width: 100%; height: 100%; object-fit: contain; }
.up-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.up-grid .el-btn img { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 12px 12px; }
.upload-zone { border: 2px dashed #CDBFB2; border-radius: 14px; padding: 18px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; background: #FBF8F5; }
.upload-zone.drag { border-color: var(--burg); background: var(--burg-xl); }
.upload-zone p { margin: 0; font-size: 12px; color: var(--muted); }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tpl-btn { border: 1px solid #EDE4DA; border-radius: 10px; background: var(--cream); padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 12px; text-align: center; }
.tpl-btn:hover { border-color: var(--burg); }
.tpl-btn canvas, .tpl-btn img { max-width: 100%; border-radius: 4px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.sw-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #D6CABD; cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #2F7DE1; }
.sw-pick { width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.layer { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #EDE4DA; border-radius: 10px; cursor: pointer; font-size: 13px; background: #fff; width: 100%; text-align: start; }
.layer.on { border-color: var(--burg); background: var(--burg-xl); }
.layer .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-stage { flex: 1; min-width: 0; background: #EFE9E2; display: flex; flex-direction: column; position: relative; }
.stage-in { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 20px; touch-action: none; }
#cv { box-shadow: 0 8px 30px rgba(42,33,29,.18); background: #fff; touch-action: none; cursor: default; outline: none; }
#cv:focus-visible { outline: 2px solid var(--burg); }
.stage-foot { display: flex; justify-content: space-between; padding: 8px 16px; font-size: 12px; color: var(--muted); }
.stage-foot .dash { display: inline-block; width: 22px; border-top: 2px dashed var(--gold); vertical-align: middle; margin-inline-end: 8px; }

.st-props { width: 290px; flex: none; border-inline-start: 1px solid #EDE4DA; background: #fff; display: flex; flex-direction: column; padding: 16px; gap: 14px; overflow-y: auto; }
#propsBody { display: flex; flex-direction: column; gap: 12px; }
.pr-h { font-weight: 600; font-size: 15px; }
.pr-row { display: flex; gap: 10px; }
.pr-row > * { flex: 1; min-width: 0; }
.st .inp, .st .sel, .st .ta { font-size: 14px; min-height: 40px; padding: 8px 12px; }
.tgl { display: flex; gap: 6px; }
.tgl button { flex: 1; min-height: 38px; border: 1px solid var(--line-d); background: #fff; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.tgl button.on { background: var(--burg); color: #fff; border-color: var(--burg); }
.range { width: 100%; accent-color: var(--burg); }
.props-sum { background: #FBF8F5; border: 1px solid #EDE4DA; border-radius: 12px; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.props-act { display: flex; flex-direction: column; gap: 8px; }
.obj-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.obj-acts .btn-g { flex: 1; min-height: 36px; padding: 6px 8px; font-size: 12.5px; }

.preview-body { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 24px; padding: 16px 0; background: var(--cream); border-radius: 12px; }

/* guided tour */
.tour { position: fixed; inset: 0; z-index: 150; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(42,33,29,.62); transition: all .25s ease; pointer-events: none; }
.tour-spot.center { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 32px)); background: #fff; border-radius: 16px; padding: 18px 18px 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); transition: top .25s, left .25s; }
.tour-card.center { width: min(420px, calc(100vw - 32px)); text-align: center; padding: 28px 24px 18px; }
.tour-card h3 { margin: 4px 0 6px; font-size: 18px; font-family: var(--serif); }
[dir="rtl"] .tour-card h3 { font-family: var(--arabic); }
.tour-card p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.tour-step { font-size: 11.5px; font-weight: 600; color: var(--burg); letter-spacing: 1px; }
.tour-btns { display: flex; gap: 8px; align-items: center; }
.tour-btns .grow { flex: 1; }
.tour-skip { background: none; border: 0; color: var(--muted); font-weight: 600; cursor: pointer; padding: 8px 4px; text-decoration: underline; }
.tour-card::before { content: ""; position: absolute; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); display: var(--arrow, none); left: var(--ax, 20px); top: var(--ay, -7px); }
.tour-mark { margin-bottom: 6px; }

/* mobile */
@media (max-width: 900px) {
  .hide-sm { display: none !important; }
  .show-sm { display: inline-flex; }
  .st-top { gap: 6px; padding: 0 10px; height: 56px; }
  .st-name { width: 120px; }
  .st-main { flex-direction: column; position: relative; }
  .st-rail { order: 3; width: auto; flex-direction: row; justify-content: space-around; border: 0; border-top: 1px solid #EDE4DA; padding: 4px; overflow-x: auto; }
  .rail-btn { min-width: 56px; padding: 6px 2px; }
  .st-stage { order: 1; }
  .stage-in { padding: 12px; }
  .st-panel, .st-props { position: absolute; inset-inline: 0; bottom: 0; width: auto; max-height: 58%; z-index: 6; border: 0; border-top: 1px solid #EDE4DA; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.12); }
  .panel-x { display: inline-flex; }
  .st-props { display: none; padding: 14px 16px; }
  .st-props.open { display: flex; }
  .st-props .props-sum, .st-props .props-act { display: none; }
  .stage-foot { padding: 6px 10px; }
}
