/*==============================================================
  Mockup Studio — xurshid.com ichidagi editor uslublari.
  Hammasi .ms-app ichida: sayt header/footer'iga ta'sir qilmaydi.
  Ranglar saytning yorug' mavzusi va yashil aksentiga moslangan.
==============================================================*/

.ms-app {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --panel-3: #eaeff4;
  --line: #e3e9ef;
  --line-strong: #cfd8e1;
  --text: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #10bc69;
  --accent-strong: #08884b;
  --accent-soft: rgba(16, 188, 105, .10);
  --danger: #dc2626;
  --ok: #10bc69;
  --radius: 10px;
  --topbar: 52px;
  --rail: 72px;
  --left: 300px;
  --right: 312px;
  color-scheme: light;
  font-family: var(--default-font, Roboto, system-ui, sans-serif);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: normal;
  color: var(--text);
}

.ms-app [hidden] { display: none !important; }
.ms-app h1, .ms-app h2, .ms-app h3, .ms-app h4, .ms-app p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; font-family: inherit; font-weight: 650; letter-spacing: normal; }
.ms-app p { font-weight: inherit; }
.ms-app button, .ms-app input, .ms-app select { font: inherit; color: inherit; }
.ms-app button { cursor: pointer; }
.ms-app button:disabled { cursor: default; }
.ms-app a { color: inherit; }
.ms-app :focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Top toolbar ---------- */
.ms-app .topbar {
  height: var(--topbar); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 30;
}
.ms-app .brand { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; text-decoration: none; margin-right: 6px; white-space: nowrap; }
.ms-app .toolbar, .ms-app .topbar-right { display: flex; align-items: center; gap: 2px; }
.ms-app .topbar-right { margin-left: auto; gap: 4px; }
.ms-app .tool {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 9px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text); text-decoration: none; white-space: nowrap;
}
.ms-app .tool:hover:not(:disabled) { background: var(--panel-3); }
.ms-app .tool:disabled { color: var(--faint); }
.ms-app .tool-sep { width: 1px; height: 20px; background: var(--line); margin: 0 5px; flex: none; }
.ms-app .icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text); flex: none;
}
.ms-app .icon-btn:hover { background: var(--panel-3); }
.ms-app .only-narrow { display: none; }

.ms-app .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 11px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); text-decoration: none; white-space: nowrap; font-weight: 500;
}
.ms-app .btn:hover:not(:disabled) { background: var(--panel-3); }
.ms-app .btn:disabled { opacity: .45; }
.ms-app .btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 600; }
.ms-app .btn.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.ms-app .btn.danger { color: var(--danger); }
.ms-app .btn.block { width: 100%; }
.ms-app .btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ms-app .btn-row .btn { flex: 1 1 auto; }
.ms-app .mini {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px;
}
.ms-app .mini:hover:not(:disabled) { background: var(--panel-3); color: var(--text); }
.ms-app .mini:disabled { opacity: .3; }

/* ---------- Workspace ---------- */
.ms-app .workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--rail) var(--left) minmax(0, 1fr) var(--right); }
.ms-app .rail {
  background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; overflow-y: auto;
}
.ms-app .rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px 7px; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 10.5px;
}
.ms-app .rail-btn:hover { color: var(--text); background: var(--panel-2); }
.ms-app .rail-btn.on { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.ms-app .rail-btn.on svg { color: var(--accent); }
.ms-app .sidebar { background: var(--panel); overflow-y: auto; overscroll-behavior: contain; }
.ms-app .sidebar.left { border-right: 1px solid var(--line); }
.ms-app .sidebar.right { border-left: 1px solid var(--line); }
.ms-app .scrim { display: none; }

.ms-app .panel-section { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ms-app .panel-section:last-child { border-bottom: 0; }
.ms-app .section-title { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; text-align: left; padding: 0; margin: 0; position: static; color: var(--text); font-family: inherit; }
.ms-app .hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
.ms-app .empty { color: var(--muted); font-size: 12px; line-height: 1.45; padding: 4px 0; }

/* ---------- Stage ---------- */
.ms-app .stage { position: relative; min-width: 0; display: flex; flex-direction: column; background: #eef2f5; background-image: radial-gradient(#d3dae2 1px, transparent 1px); background-size: 18px 18px; }
.ms-app .viewport { flex: 1; min-height: 0; overflow: auto; display: flex; }
.ms-app .canvas-wrap {
  position: relative; margin: auto; flex: none; box-shadow: 0 10px 40px rgba(15, 23, 42, .16);
  background-color: #fff;
  background-image: linear-gradient(45deg, #cfd2d6 25%, transparent 25%), linear-gradient(-45deg, #cfd2d6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #cfd2d6 75%), linear-gradient(-45deg, transparent 75%, #cfd2d6 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.ms-app .canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ms-app #overlay-canvas { touch-action: none; }
.ms-app .canvas-wrap.adjusting { outline: 2px solid #ffb020; outline-offset: 3px; }
.ms-app .drop-hint {
  position: absolute; inset: 12px 12px 58px; display: none; flex-direction: column; gap: 8px; align-items: center; justify-content: flex-start; padding-top: 22px;
  border: 2px dashed var(--ok); border-radius: 14px; color: var(--ok); font-weight: 600; pointer-events: none; background: rgba(61, 220, 151, .05);
}
.ms-app .stage.dropping .drop-hint { display: flex; }
.ms-app .stagebar {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 46px; padding: 6px 10px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap;
}
.ms-app .zoom-label { min-width: 54px; height: 30px; border: 0; background: transparent; border-radius: 6px; font-variant-numeric: tabular-nums; }
.ms-app .zoom-label:hover { background: var(--panel-3); }
.ms-app .stagebar-sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.ms-app .stagebar-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; }
.ms-app .stagebar-btn:hover:not(:disabled) { background: var(--panel-3); }
.ms-app .stagebar-btn:disabled { color: var(--faint); }
.ms-app .stagebar-btn.on { background: rgba(245, 158, 11, .14); color: #b45309; }
.ms-app .status { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Accordions ---------- */
.ms-app .acc { border-bottom: 1px solid var(--line); }
.ms-app .acc summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 650; font-size: 12.5px; list-style: none; user-select: none;
}
.ms-app .acc summary::-webkit-details-marker { display: none; }
.ms-app .acc summary:hover { background: var(--panel-2); }
.ms-app .acc summary svg:first-child { color: var(--muted); }
.ms-app .acc summary svg:last-child { margin-left: auto; color: var(--faint); transition: transform .15s; }
.ms-app .acc[open] summary svg:last-child { transform: rotate(180deg); }
.ms-app .acc-body { padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.ms-app .acc-body > .dynamic:empty { display: none; }

/* ---------- Controls ---------- */
.ms-app .ctl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 8px; }
.ms-app .ctl.disabled { opacity: .42; }
.ms-app .ctl-label { color: var(--muted); font-size: 12px; }
.ms-app .ctl-value { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; }
.ms-app .ctl input[type="range"] { grid-column: 1 / -1; }
.ms-app .num, .ms-app .hex, .ms-app .text, .ms-app select, .ms-app .search {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; height: 26px; padding: 0 6px; min-width: 0;
}
.ms-app .num { width: 54px; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.ms-app .num::-webkit-inner-spin-button { display: none; }
.ms-app .num.wide { width: 100%; text-align: left; height: 30px; }
.ms-app .num:focus, .ms-app .hex:focus, .ms-app .text:focus, .ms-app select:focus, .ms-app .search:focus { border-color: var(--accent); outline: none; }
.ms-app .ctl-select { grid-template-columns: 1fr; }
.ms-app .ctl-number { grid-template-columns: 1fr; }
.ms-app .ctl-select select { width: 100%; height: 32px; }
.ms-app .text { width: 100%; height: 30px; }
.ms-app .search { width: 100%; height: 32px; padding: 0 10px; }
.ms-app .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ms-app input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; margin: 0; cursor: pointer;
}
.ms-app input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--panel-3) var(--fill, 0%));
}
.ms-app input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.ms-app input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--panel-3); }
.ms-app input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.ms-app input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.ms-app input[type="range"]:disabled { cursor: default; }

.ms-app .ctl-color { grid-template-columns: 1fr auto; }
.ms-app .color-field { display: inline-flex; align-items: center; gap: 5px; }
.ms-app .color-field input[type="color"] { width: 28px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.ms-app .color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.ms-app .color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.ms-app .hex { width: 72px; font-variant-numeric: tabular-nums; }

.ms-app .ctl-toggle { grid-template-columns: 1fr auto; cursor: pointer; }
.ms-app .ctl-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ms-app .switch { width: 32px; height: 18px; border-radius: 18px; background: #cbd5e1; position: relative; transition: background .12s; }
.ms-app .switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .12s; }
.ms-app .ctl-toggle input:checked + .switch { background: var(--accent-strong); }
.ms-app .ctl-toggle input:checked + .switch::after { transform: translateX(14px); }
.ms-app .ctl-toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 1px; }

.ms-app .ctl-seg { grid-template-columns: 1fr; }
.ms-app .segmented { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px; gap: 2px; }
.ms-app .seg { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 26px; padding: 0 6px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ms-app .seg:hover:not(:disabled):not(.on) { color: var(--text); }
.ms-app .seg.on { background: var(--panel-3); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); }
.ms-app .seg:disabled { opacity: .4; }

/* ---------- Chips / grids ---------- */
.ms-app .chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ms-app .chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 15px; background: transparent; color: var(--muted); font-size: 12px; }
.ms-app .chip:hover { color: var(--text); border-color: var(--line-strong); }
.ms-app .chip.on { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.ms-app .chip .count { color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ms-app .chip.on .count { color: var(--accent-strong); }

.ms-app .template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ms-app .template-card { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; min-width: 0; }
.ms-app .template-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 8px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.ms-app .template-card:hover .template-thumb { border-color: var(--accent); }
.ms-app .template-thumb canvas { max-width: 100%; max-height: 100%; display: block; }
.ms-app .template-name { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ms-app .device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ms-app .device-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; min-width: 0; outline-offset: -1px;
}
.ms-app .device-card:hover { border-color: var(--accent); }
.ms-app .device-card img { height: 84px; max-width: 100%; object-fit: contain; display: block; }
.ms-app .device-name { font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.2; }
.ms-app .device-add {
  position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px; background: var(--panel-3); color: var(--text); opacity: 0;
}
.ms-app .device-card:hover .device-add, .ms-app .device-add:focus-visible { opacity: 1; }
.ms-app .device-add:hover { background: var(--accent-strong); color: #fff; }
@media (hover: none) { .ms-app .device-add { opacity: 1; } }

.ms-app .dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; border: 1.5px dashed var(--line-strong); border-radius: 10px; text-align: center; cursor: pointer; color: var(--muted);
}
.ms-app .dropzone strong { color: var(--text); font-size: 13px; }
.ms-app .dropzone small { color: var(--faint); font-size: 11px; }
.ms-app .dropzone:hover, .ms-app .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.ms-app .media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ms-app .media-grid + .btn { margin-top: 10px; }
.ms-app .media-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ms-app .media-thumb { display: grid; place-items: center; height: 92px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.ms-app .media-thumb:hover { border-color: var(--accent); }
.ms-app .media-thumb canvas { max-width: 100%; max-height: 100%; display: block; }
.ms-app .media-name { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-app .media-actions { display: flex; justify-content: space-between; }
.ms-app .media-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ms-app .media-info strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-app .media-info small { color: var(--muted); }

.ms-app .style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ms-app .style-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 11px; color: var(--muted); }
.ms-app .style-card:hover:not(:disabled), .ms-app .style-card.on { border-color: var(--accent); color: var(--text); }
.ms-app .style-card.on { background: var(--accent-soft); }
.ms-app .style-card:disabled { opacity: .45; }
.ms-app .style-preview { width: 22px; height: 36px; display: block; }
.ms-app .style-preview i { display: block; width: 100%; height: 100%; border-radius: 5px; }
.ms-app .s-realistic i { background: linear-gradient(135deg, #7a7f88, #2c2f35); box-shadow: inset 0 0 0 2px #15171b, inset 0 0 0 3px #8f94a0; }
.ms-app .s-clay i { background: #c9ccd2; }
.ms-app .s-glass i { background: rgba(15, 23, 42, .05); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .28); }
.ms-app .s-outline i { box-shadow: inset 0 0 0 1.5px #475569; }

.ms-app .swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-app .swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .18); }
.ms-app .swatch:hover { transform: scale(1.08); }
.ms-app .swatch.on { outline: 2px solid var(--accent); outline-offset: 2px; }

.ms-app .shadow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ms-app .shadow-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 2px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 11px; color: var(--muted); }
.ms-app .shadow-card:hover:not(:disabled), .ms-app .shadow-card.on { border-color: var(--accent); color: var(--text); }
.ms-app .shadow-card.on { background: var(--accent-soft); }
.ms-app .shadow-card:disabled { opacity: .45; }
.ms-app .shadow-demo i { display: block; width: 26px; height: 22px; border-radius: 4px; background: #fff; border: 1px solid #e2e8f0; }
.ms-app .d-soft i { box-shadow: 0 5px 12px rgba(15, 23, 42, .35); }
.ms-app .d-spread i { box-shadow: 0 9px 20px 2px rgba(15, 23, 42, .42); }
.ms-app .d-hard i { box-shadow: 4px 5px 0 rgba(15, 23, 42, .7); }
.ms-app .d-custom i { box-shadow: -5px 5px 10px rgba(16, 188, 105, .7); }

.ms-app .swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ms-app .bg-swatch { aspect-ratio: 1; border-radius: 8px; border: 0; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12); }
.ms-app .bg-swatch:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.ms-app .photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ms-app .bg-photo { padding: 0; border: 0; background: none; border-radius: 8px; overflow: hidden; aspect-ratio: 3 / 2; }
.ms-app .bg-photo:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.ms-app .bg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-app .bg-content { display: flex; flex-direction: column; gap: 8px; }

.ms-app .layer { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.ms-app .layer:hover { background: var(--panel-2); }
.ms-app .layer.on { background: var(--accent-soft); border-color: var(--accent); }
.ms-app .layer.static { cursor: default; opacity: .75; }
.ms-app .layer.static:hover { background: none; }
.ms-app .layer-thumb { width: 30px; height: 36px; object-fit: contain; flex: none; }
.ms-app .bg-thumb { display: block; border-radius: 5px; background: linear-gradient(135deg, #6a78f0, #2b6cb0); }
.ms-app .layer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ms-app .layer-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-app .layer-text small { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-app .layer-actions { display: flex; flex: none; }
.ms-app .layer-actions .mini { min-width: 20px; padding: 0 1px; }

.ms-app .preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ms-app .preset-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 11px; line-height: 1.2; text-align: center; }
.ms-app .preset-card:hover { border-color: var(--accent); color: var(--text); }
.ms-app .preset-art { width: 64px; height: 48px; color: #94a3b8; display: block; }
.ms-app .preset-art svg { width: 100%; height: 100%; display: block; }
.ms-app .preset-card:hover .preset-art { color: var(--accent); }

.ms-app .tilt-pad {
  position: relative; height: 112px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); cursor: crosshair; touch-action: none; overflow: hidden;
}
.ms-app .tilt-pad.disabled { opacity: .42; cursor: default; }
.ms-app .tilt-axis-h, .ms-app .tilt-axis-v { position: absolute; background: var(--line-strong); }
.ms-app .tilt-axis-h { left: 0; right: 0; top: 50%; height: 1px; }
.ms-app .tilt-axis-v { top: 0; bottom: 0; left: 50%; width: 1px; }
.ms-app .tilt-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.ms-app .output-size { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; text-align: center; padding: 6px; background: var(--panel-2); border-radius: 6px; }

/* ---------- Toasts ---------- */
.ms-app .toasts { position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 200; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.ms-app .toast { display: flex; align-items: center; gap: 12px; width: auto; max-width: 100%; padding: 10px 14px; border-radius: 12px; background: #0f172a; color: #fff; border: 1px solid #0f172a; box-shadow: 0 12px 30px rgba(15, 23, 42, .22); pointer-events: auto; line-height: 1.35; font-size: 13px; }
.ms-app .toast.error { background: #b91c1c; border-color: #b91c1c; }
.ms-app .toast.success { background: #08884b; border-color: #08884b; }
.ms-app .toast-action { border: 0; background: none; color: #6ee7b7; font-weight: 650; padding: 0; }

/* ---------- Dialogs ---------- */
.ms-app dialog { color: var(--text); }
.ms-app dialog::backdrop { background: rgba(15, 23, 42, .55); }
.ms-app .modal { position: fixed; inset: 0; margin: auto; z-index: auto; display: none; width: fit-content; height: fit-content; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); overflow: auto; box-shadow: 0 24px 60px rgba(15, 23, 42, .2); }
.ms-app .modal[open] { display: block; }
.ms-app .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ms-app .modal-head h2 { font-size: 14px; }
.ms-app .modal-foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.ms-app .spacer { flex: 1; }
.ms-app .crop-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; }
.ms-app .crop-info { color: var(--muted); font-variant-numeric: tabular-nums; }
.ms-app .crop-stage { position: relative; margin: 8px 22px 22px; touch-action: none; user-select: none; }
.ms-app .crop-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ms-app .crop-shade { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62); }
.ms-app .crop-image { display: block; }
.ms-app .crop-box { position: absolute; outline: 1.5px solid #fff; cursor: move; }
.ms-app .crop-box::before, .ms-app .crop-box::after { content: ""; position: absolute; pointer-events: none; }
.ms-app .crop-box::before { inset: 33.33% 0; border-block: 1px solid rgba(255, 255, 255, .35); }
.ms-app .crop-box::after { inset: 0 33.33%; border-inline: 1px solid rgba(255, 255, 255, .35); }
.ms-app .crop-handle { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 3px; z-index: 1; }
.ms-app .h-nw { left: -7px; top: -7px; cursor: nwse-resize; } .ms-app .h-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.ms-app .h-sw { left: -7px; bottom: -7px; cursor: nesw-resize; } .ms-app .h-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.ms-app .h-n { left: calc(50% - 7px); top: -7px; cursor: ns-resize; } .ms-app .h-s { left: calc(50% - 7px); bottom: -7px; cursor: ns-resize; }
.ms-app .h-w { top: calc(50% - 7px); left: -7px; cursor: ew-resize; } .ms-app .h-e { top: calc(50% - 7px); right: -7px; cursor: ew-resize; }

.ms-app .preview-modal { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 20px; margin: 0; background: #08090b; display: grid; place-items: center; }
.ms-app .preview-modal:not([open]) { display: none; }
.ms-app .preview-modal.checker { background: repeating-conic-gradient(#d6d8db 0 25%, #fff 0 50%) 0 0 / 24px 24px; }
.ms-app .preview-canvas { max-width: 100%; max-height: calc(100dvh - 40px); display: block; box-shadow: 0 10px 60px rgba(0, 0, 0, .6); }
.ms-app .preview-close { position: fixed; top: 14px; right: 14px; background: var(--panel-3); z-index: 1; }

/* ---------- Loading ---------- */
.ms-app .app-loading { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: var(--bg); z-index: 100; color: var(--muted); text-align: center; padding: 20px; }
.ms-app .spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--panel-3); border-top-color: var(--accent); animation: ms-spin .8s linear infinite; }
@keyframes ms-spin { to { transform: rotate(360deg); } }
.ms-app .noscript { padding: 30px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .ms-app { --left: 264px; --right: 286px; }
  .ms-app .toolbar .tool span, .ms-app .topbar-right .tool span { display: none; }
}
@media (max-width: 1080px) {
  .ms-app .only-narrow { display: inline-grid; }
  .ms-app .workspace { grid-template-columns: minmax(0, 1fr); position: relative; }
  .ms-app .rail {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 26; flex-direction: row; overflow-x: auto; padding: 4px; border-right: 0; border-top: 1px solid var(--line); padding-bottom: max(4px, env(safe-area-inset-bottom));
  }
  .ms-app .rail-btn { flex: 1 0 58px; }
  .ms-app .stage { padding-bottom: 62px; }
  .ms-app .sidebar.left, .ms-app .sidebar.right {
    position: absolute; top: var(--topbar); bottom: 62px; width: min(340px, calc(100vw - 40px)); z-index: 25; transition: transform .18s; box-shadow: 0 0 40px rgba(15, 23, 42, .18);
  }
  .ms-app .sidebar.left { left: 0; transform: translateX(-105%); }
  .ms-app .sidebar.right { right: 0; bottom: 0; transform: translateX(105%); }
  body.left-open .ms-app .sidebar.left, body.right-open .ms-app .sidebar.right { transform: none; }
  .ms-app .scrim { display: block; position: absolute; inset: var(--topbar) 0 0; background: rgba(15, 23, 42, .35); z-index: 24; opacity: 0; pointer-events: none; transition: opacity .18s; }
  body.left-open .ms-app .scrim, body.right-open .ms-app .scrim { opacity: 1; pointer-events: auto; }
  .ms-app .toasts { bottom: 122px; }
}
@media (max-width: 720px) {
  .ms-app .brand span { display: none; }
  .ms-app .toolbar .tool, .ms-app .topbar-right .tool { padding: 0 7px; }
  .ms-app .topbar { gap: 4px; padding: 0 6px; }
  .ms-app .tool-sep, .ms-app a.tool { display: none; }
  .ms-app #btn-export { padding: 0 9px; }
  .ms-app .stagebar { gap: 1px; padding: 4px; }
  .ms-app .stagebar-btn span, .ms-app .status, .ms-app .stagebar-sep { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-app * { transition: none !important; }
}

/* ---------- Shared page layout (admin, screenshot) ---------- */
.ms-app .page-main { width: min(1240px, 100%); margin: 0 auto; padding: 22px 18px 60px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.ms-app .page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.ms-app .page-head h1, .ms-app .page-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.ms-app .page-head p { color: var(--muted); margin-top: 3px; line-height: 1.45; }
.ms-app .card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
.ms-app .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ms-app .field > span { color: var(--muted); font-size: 12px; }
.ms-app .field input[type="text"], .ms-app .field input[type="url"], .ms-app .field input[type="number"], .ms-app .field input[type="password"], .ms-app .field select {
  height: 36px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; width: 100%; min-width: 0;
}
.ms-app .field input:focus, .ms-app .field select:focus { border-color: var(--accent); outline: none; }
.ms-app .notice { padding: 11px 13px; border-radius: 8px; line-height: 1.45; background: var(--panel-2); border: 1px solid var(--line-strong); }
.ms-app .notice.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ms-app .notice.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ms-app .notice code { background: rgba(15, 23, 42, .06); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* Screenshot page */
.ms-app .shot-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.ms-app .shot-form { display: flex; flex-direction: column; gap: 14px; }
.ms-app .shot-result { min-height: 420px; display: flex; flex-direction: column; gap: 12px; }
.ms-app .shot-frame { flex: 1; display: grid; place-items: center; min-height: 340px; max-height: 70dvh; overflow: auto; background: var(--panel-2); border-radius: 8px; color: var(--muted); padding: 14px; text-align: center; }
.ms-app .shot-frame img { max-width: 100%; display: block; box-shadow: 0 6px 30px rgba(0, 0, 0, .45); }
.ms-app .profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.ms-app .profile { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); text-align: left; min-width: 0; }
.ms-app .profile small { display: block; color: var(--muted); font-size: 10.5px; }
.ms-app .profile:hover { border-color: var(--line-strong); }
.ms-app .profile.on { border-color: var(--accent); background: var(--accent-soft); }
.ms-app .result-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 860px) { .ms-app .shot-layout { grid-template-columns: 1fr; } }

/* Admin */
.ms-app .admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ms-app .admin-toolbar .search { width: 220px; height: 34px; }
.ms-app .admin-toolbar select { height: 34px; }
.ms-app .admin-group { display: flex; flex-direction: column; gap: 8px; }
.ms-app .admin-group h2 { font-size: 13px; color: var(--muted); font-weight: 600; }
.ms-app .admin-list { display: flex; flex-direction: column; gap: 6px; }
.ms-app .admin-row { display: grid; grid-template-columns: 52px minmax(0, 1.6fr) 90px minmax(0, 1fr) 72px auto; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.ms-app .admin-row.inactive { opacity: .55; }
.ms-app .admin-row img { width: 52px; height: 52px; object-fit: contain; display: block; }
.ms-app .admin-row strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-app .admin-row small { color: var(--muted); }
.ms-app .admin-cell-muted { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-app .admin-actions { display: flex; gap: 2px; align-items: center; }
.ms-app .admin-row .ctl-toggle { display: inline-grid; grid-template-columns: auto; }
@media (max-width: 760px) {
  .ms-app .admin-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .ms-app .admin-row .admin-cell-muted { display: none; }
  .ms-app .admin-row img { width: 44px; height: 44px; }
}

.ms-app .editor-modal { width: min(1120px, calc(100vw - 24px)); }
.ms-app .editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; }
.ms-app .editor-canvas { padding: 14px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); min-width: 0; }
.ms-app .editor-side { padding: 14px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100dvh - 130px); overflow-y: auto; }
.ms-app .coord-stage {
  position: relative; display: grid; place-items: center; min-height: 380px; border-radius: 8px; overflow: hidden; touch-action: none; user-select: none;
  background: repeating-conic-gradient(#e9edf1 0 25%, #f8fafc 0 50%) 0 0 / 22px 22px;
}
.ms-app .coord-inner { position: relative; }
.ms-app .coord-inner img { display: block; max-width: 100%; }
.ms-app .coord-inner canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.ms-app .file-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ms-app .file-field .file-name { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 100px; }
.ms-app .field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ms-app .field-title { font-weight: 650; font-size: 12.5px; }
.ms-app .color-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 78px auto; gap: 6px; align-items: center; }
.ms-app .color-row input[type="text"] { height: 28px; padding: 0 7px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; min-width: 0; width: 100%; }
.ms-app .color-row input[type="color"] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.ms-app .check-field { display: flex; gap: 8px; align-items: center; }
.ms-app .category-row { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ms-app .category-row:last-child { border-bottom: 0; }
.ms-app .category-row span:first-child { flex: 1; min-width: 0; }
.ms-app .category-row small { color: var(--muted); margin-left: 6px; }
@media (max-width: 880px) {
  .ms-app .editor-grid { grid-template-columns: 1fr; }
  .ms-app .editor-canvas { border-right: 0; border-bottom: 1px solid var(--line); }
  .ms-app .editor-side { max-height: none; }
}


/*==============================================================
  Sayt bilan moslik
==============================================================*/

/* Editor sahifasi: sayt header'idan pastdagi butun ekran. Footer pastda qoladi. */
.ms-page .ms-main { padding: 0; }
.ms-app.ms-editor {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  height: calc(100dvh - var(--ms-site-header, 66px)); min-height: 560px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.ms-app.ms-editor:fullscreen { height: 100vh; min-height: 0; }
.ms-app.ms-editor .workspace { flex: 1; min-height: 0; }
.ms-page #scroll-top { display: none !important; }

/* Hujjat sahifalari (Screenshot, Asset Manager) */
.ms-app.ms-doc { background: var(--background-color, #fff); }
.ms-app.ms-doc .page-main { width: auto; padding: 28px 0 72px; }
.ms-app.ms-doc .page-head p { margin: 0; font-size: 14px; }
.ms-app .page-head h1, .ms-app .page-head h2 { font-family: var(--heading-font, inherit); color: var(--text); }

/* Topbar brendi saytning yashil belgisida */
.ms-app .brand { color: var(--text); font-family: var(--heading-font, inherit); font-weight: 800; letter-spacing: -.2px; }
.ms-app .brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, #10bc69 0%, #0ea5a5 100%); color: #fff; box-shadow: 0 4px 12px rgba(16, 188, 105, .3); }
.ms-app .topbar { box-shadow: 0 1px 0 var(--line); }

/* Saytning global qoidalari: img/svg/canvas { max-width: 100%; height: auto } */
.ms-app svg { max-width: none; }
.ms-app img { max-width: none; }

/* Bootstrap .btn bilan bir xil nom: o'lcham, holatlar */
.ms-app .btn { font-family: inherit; font-size: 13px; line-height: 1.2; user-select: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.ms-app .btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.ms-app .btn:active, .ms-app .btn:focus-visible { background: var(--panel-3); border-color: var(--line-strong); color: var(--text); box-shadow: none; }
.ms-app .btn.primary { box-shadow: 0 6px 16px rgba(16, 188, 105, .25); }
.ms-app .btn.primary:hover:not(:disabled), .ms-app .btn.primary:active, .ms-app .btn.primary:focus-visible { background: #0a7a44; border-color: #0a7a44; color: #fff; }
.ms-app .btn.danger, .ms-app .btn.danger:hover:not(:disabled) { color: var(--danger); }
.ms-app .btn:disabled { pointer-events: none; }

/* Sayt havolalari rangini editor ichida qaytarmaymiz */
.ms-app a:hover { color: inherit; }
.ms-app a.btn.primary, .ms-app a.btn.primary:hover { color: #fff; }

/* Bootstrap .toast: odatda yashirin, 350px */
.ms-app .toasts .toast { display: flex; }

/* section elementlari sayt bo'ylab 60-72px padding oladi */
.ms-app section { background: transparent; scroll-margin-top: 0; padding: 0; overflow: visible; }

/* Inputlar sayt bilan bir xil yumshoq burchakda */
.ms-app .field input[type="text"], .ms-app .field input[type="url"], .ms-app .field input[type="number"], .ms-app .field input[type="password"], .ms-app .field select { border-radius: 10px; }
.ms-app .field input:focus, .ms-app .field select:focus, .ms-app .num:focus, .ms-app .hex:focus, .ms-app .text:focus, .ms-app select:focus, .ms-app .search:focus { box-shadow: 0 0 0 3px rgba(16, 188, 105, .15); }

@media (max-width: 1080px) {
  .ms-app.ms-editor { min-height: 520px; }
  /* Drawers sit in .workspace (already below the topbar), not in the viewport. */
  .ms-app .sidebar.left, .ms-app .sidebar.right { top: 0; }
}
