@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f7f7;
  --surface: #ffffff;
  --surface-muted: #f1f4f3;
  --surface-strong: #e6ecea;
  --text: #14201d;
  --text-secondary: #56635f;
  --text-tertiary: #7a8783;
  --border: #dce3e1;
  --border-strong: #c9d3d0;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-soft: #e1f3f0;
  --success: #15803d;
  --success-soft: #e9f7ee;
  --danger: #b42318;
  --danger-hover: #912018;
  --danger-soft: #fff0ee;
  --focus: #0d9488;
  --shadow-sm: 0 1px 2px rgba(16, 35, 30, .05);
  --shadow-md: 0 16px 40px rgba(16, 35, 30, .12);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --max-width: 1240px;
  --ease: 160ms ease;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: 'Vazirmatn', Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 500; padding: 10px 14px; background: var(--text); color: white; border-radius: 8px; transition: top var(--ease); }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 42%, transparent); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(24px, calc((100vw - var(--max-width)) / 2)); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: var(--text); border-radius: 10px; }
.brand-mark svg { width: 22px; height: 22px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { color: var(--text-tertiary); font-size: 11px; margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; }

.workspace { width: min(calc(100% - 48px), var(--max-width)); margin: 0 auto; padding: 46px 0 80px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 7px; color: var(--primary); font-size: 11px; line-height: 1; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow.destructive { color: var(--danger); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(30px, 4vw, 42px); line-height: 1.08; letter-spacing: -.045em; font-weight: 680; }
.page-heading p:last-child { margin: 0; color: var(--text-secondary); font-size: 15px; }

.btn { min-height: 40px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 650; text-decoration: none; white-space: nowrap; transition: background var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-large { min-height: 44px; padding-inline: 17px; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-muted); border-color: #b8c5c1; }
.btn-danger { background: transparent; color: var(--danger); border-color: #eac2bd; }
.btn-danger:hover { background: var(--danger-soft); border-color: #d99b93; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: white; }
.btn-danger-solid:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-block { width: 100%; }

.status-strip { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 38px; }
.status-item { min-width: 0; padding: 19px 22px; display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; }
.status-item + .status-item { border-left: 1px solid var(--border); }
.status-label { color: var(--text-tertiary); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.status-item strong { grid-column: 1; font-size: 18px; letter-spacing: -.025em; }
.status-note { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--text-secondary); font-size: 12px; text-align: right; }
.status-with-dot { display: flex; align-items: center; gap: 7px; }
.status-with-dot i, .live-indicator i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-with-dot.offline i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.library-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.library-toolbar h2 { margin-bottom: 3px; font-size: 19px; letter-spacing: -.025em; }
.library-toolbar p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.search-field { width: 260px; height: 40px; position: relative; }
.search-field svg { width: 17px; height: 17px; position: absolute; left: 12px; top: 11px; fill: none; stroke: var(--text-tertiary); stroke-width: 1.8; pointer-events: none; }
.search-field input { width: 100%; height: 100%; padding: 0 12px 0 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; outline: none; }
.search-field input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 17%, transparent); }
.search-field input::placeholder { color: var(--text-tertiary); }

.marker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.marker-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: border-color var(--ease), box-shadow var(--ease); }
.marker-card:hover { border-color: var(--border-strong); box-shadow: 0 7px 22px rgba(16,35,30,.07); }
.marker-preview { height: 186px; padding: 18px; position: relative; display: grid; place-items: center; background-color: #edf1f0; background-image: linear-gradient(45deg, #e4e9e7 25%, transparent 25%), linear-gradient(-45deg, #e4e9e7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e4e9e7 75%), linear-gradient(-45deg, transparent 75%, #e4e9e7 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0px; border-bottom: 1px solid var(--border); }
.marker-preview img { position: absolute; inset: 18px; display: block; width: calc(100% - 36px); height: calc(100% - 36px); min-width: 0; min-height: 0; object-fit: contain; filter: drop-shadow(0 5px 8px rgba(18,32,29,.13)); }
.ready-badge { position: absolute; z-index: 1; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #bde2c9; border-radius: 99px; color: #166534; background: rgba(240,253,244,.94); font-size: 11px; font-weight: 700; }
.ready-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.marker-content { min-height: 218px; padding: 17px; display: flex; flex-direction: column; }
.marker-title-row { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.marker-name { margin: 0; overflow: hidden; color: var(--text); font-size: 15px; line-height: 1.35; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.marker-id { display: block; margin-top: 3px; overflow: hidden; color: var(--text-tertiary); font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.model-pill { flex: 0 0 auto; max-width: 116px; padding: 3px 7px; overflow: hidden; color: var(--text-secondary); background: var(--surface-muted); border-radius: 5px; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.marker-meta { margin: 16px 0 0; padding: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.marker-meta dt { color: var(--text-tertiary); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.marker-meta dd { margin: 2px 0 0; overflow: hidden; color: var(--text-secondary); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.marker-actions { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 7px; margin-top: auto; padding-top: 15px; }
.marker-actions .btn { min-height: 38px; padding-inline: 10px; }
.marker-actions .btn-delete-card { padding: 0; color: var(--danger); }

.empty-state { grid-column: 1/-1; min-height: 310px; padding: 48px 24px; display: grid; place-items: center; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.empty-state-inner { max-width: 390px; }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 17px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 13px; }
.empty-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.empty-state h3 { margin: 0 0 5px; font-size: 17px; }
.empty-state p { margin: 0 0 20px; color: var(--text-secondary); font-size: 13px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; overflow-y: auto; background: rgba(18,27,25,.56); opacity: 0; visibility: hidden; transition: opacity var(--ease), visibility var(--ease); }
.modal-backdrop.active { opacity: 1; visibility: visible; }
.modal { width: min(100%, 1040px); max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border: 1px solid rgba(255,255,255,.45); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); transform: translateY(8px); transition: transform var(--ease); }
.modal-backdrop.active .modal { transform: translateY(0); }
.modal-small { width: min(100%, 440px); }
.modal-header { min-height: 76px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 4; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal-header .eyebrow { margin-bottom: 5px; }
.modal-header h2 { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -.025em; }
.icon-btn { width: 40px; height: 40px; padding: 0; flex: 0 0 auto; display: grid; place-items: center; color: var(--text-secondary); background: transparent; border: 0; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: var(--surface-muted); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.modal-form { display: block; }
.form-error { margin: 20px 22px 0; padding: 11px 13px; color: #7f1d1d; background: var(--danger-soft); border: 1px solid #f2c6c0; border-radius: 8px; font-size: 13px; }
.editor-layout { padding: 22px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 24px; }
.editor-fields { display: flex; flex-direction: column; gap: 18px; }
.form-group { min-width: 0; }
.form-group > label, .transform-panel legend { display: block; margin-bottom: 7px; color: var(--text); font-size: 12px; font-weight: 700; }
.form-group > small { display: block; margin-top: 5px; color: var(--text-tertiary); font-size: 11px; }
.required, .optional { margin-left: 5px; font-size: 10px; font-weight: 650; }
.required { color: var(--danger); }
.optional { color: var(--text-tertiary); }
.form-input { width: 100%; height: 42px; padding: 0 12px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); outline: none; transition: border-color var(--ease), box-shadow var(--ease); }
.form-input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 17%, transparent); }
.form-input[aria-invalid="true"] { border-color: var(--danger); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.file-dropzone { width: 100%; min-height: 102px; padding: 13px; display: flex; align-items: center; gap: 11px; text-align: left; background: var(--surface-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--text-secondary); transition: background var(--ease), border-color var(--ease); }
.file-dropzone:hover, .file-dropzone.drag-active { background: var(--primary-soft); border-color: var(--primary); }
.file-dropzone.has-file { background: var(--success-soft); border-color: #8fcfa3; border-style: solid; }
.file-dropzone > svg { width: 26px; height: 26px; flex: 0 0 auto; fill: none; stroke: var(--primary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.file-dropzone span { min-width: 0; }
.file-dropzone strong, .file-dropzone small { display: block; }
.file-dropzone strong { max-width: 160px; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.file-dropzone small { margin-top: 3px; color: var(--text-tertiary); font-size: 10px; }
.file-dropzone-wide { min-height: 82px; }
.module-composer { padding-top: 2px; }
.composer-heading { margin-bottom: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.composer-heading h3 { margin: 0 0 2px; font-size: 13px; letter-spacing: -.01em; }
.composer-heading p { margin: 0; color: var(--text-tertiary); font-size: 10px; }
.module-count { flex: 0 0 auto; padding: 3px 7px; color: var(--primary); background: var(--primary-soft); border-radius: 99px; font-size: 9px; font-weight: 750; }
.module-list { display: flex; flex-direction: column; gap: 9px; }
.module-empty { padding: 22px 16px; color: var(--text-secondary); text-align: center; background: var(--surface-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 11px; }
.content-module { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.content-module.is-disabled { opacity: .62; }
.content-module.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.module-header { min-height: 51px; padding: 8px 9px; display: flex; align-items: center; gap: 9px; background: var(--surface-muted); border-bottom: 1px solid var(--border); }
.module-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 8px; }
.module-icon.video { color: #1d4ed8; background: #eaf0ff; }.module-icon.audio { color: #7e22ce; background: #f5ebff; }.module-icon.text { color: #b45309; background: #fff3dd; }
.module-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.module-title { min-width: 0; flex: 1; }
.module-title strong, .module-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module-title strong { font-size: 11px; text-transform: capitalize; }.module-title small { color: var(--text-tertiary); font-size: 9px; }
.module-controls { display: flex; gap: 3px; }
.module-control { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; color: var(--text-secondary); background: transparent; border: 0; border-radius: 7px; }
.module-control:hover { color: var(--text); background: var(--surface-strong); }.module-control.danger:hover { color: var(--danger); background: var(--danger-soft); }.module-control:disabled { opacity: .35; cursor: not-allowed; }
.module-control svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.module-enabled { width: 36px; height: 20px; position: relative; flex: 0 0 auto; }
.module-enabled input { position: absolute; opacity: 0; }
.module-enabled span { position: absolute; inset: 0; background: #c9d3d0; border-radius: 99px; transition: background var(--ease); }
.module-enabled span::after { content: ""; position: absolute; width: 16px; height: 16px; top: 2px; left: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform var(--ease); }
.module-enabled input:checked + span { background: var(--primary); }.module-enabled input:checked + span::after { transform: translateX(16px); }.module-enabled input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent); outline-offset: 2px; }
.module-body { padding: 11px; display: flex; flex-direction: column; gap: 11px; }
.module-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.module-field { min-width: 0; }
.module-field.full { grid-column: 1/-1; }
.module-field label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 9px; font-weight: 700; }
.module-input, .module-select, .module-textarea { width: 100%; color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; outline: none; }
.module-input, .module-select { height: 34px; padding: 0 9px; font-size: 10px; }.module-textarea { min-height: 70px; padding: 8px 9px; resize: vertical; font-size: 11px; line-height: 1.4; }
.module-input:focus, .module-select:focus, .module-textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 16%, transparent); }
.module-range-row { display: grid; grid-template-columns: 1fr 42px; align-items: center; gap: 8px; }
.module-range-row input[type="range"] { width: 100%; accent-color: var(--primary); }.module-range-row output { color: var(--primary); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; }
.module-file { min-height: 54px; padding: 8px 10px; display: flex; align-items: center; gap: 9px; color: var(--text-secondary); background: var(--surface-muted); border: 1px dashed var(--border-strong); border-radius: 7px; }
.module-file:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }.module-file.has-file { border-style: solid; border-color: #8fcfa3; background: var(--success-soft); }
.module-file svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }.module-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.module-checks { display: flex; flex-wrap: wrap; gap: 12px; }
.module-checks label { display: inline-flex; align-items: center; gap: 5px; color: var(--text-secondary); font-size: 9px; }.module-checks input { accent-color: var(--primary); }
.module-check-line { min-height: 36px; padding: 7px 10px; display: flex !important; align-items: center; gap: 8px; color: var(--text-secondary); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 6px; font-size: 10px !important; font-weight: 650; cursor: pointer; }
.module-check-line input { width: 15px; height: 15px; accent-color: var(--primary); }
.module-input:disabled, .module-select:disabled { cursor: not-allowed; opacity: .45; background: var(--surface-muted); }
.module-add-panel { margin-top: 9px; padding: 10px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 9px; }
.module-add-panel > span { display: block; margin-bottom: 7px; color: var(--text-tertiary); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.module-type-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.module-type-button { min-width: 0; min-height: 68px; padding: 8px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-secondary); background: #fff; border: 1px solid var(--border); border-radius: 7px; transition: border-color var(--ease), color var(--ease), background var(--ease); }
.module-type-button:hover { color: var(--primary); background: var(--primary-soft); border-color: var(--primary); }.module-type-button svg { width: 18px; height: 18px; margin-bottom: 5px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }.module-type-button strong { font-size: 9px; }.module-type-button small { margin-top: 1px; color: var(--text-tertiary); font-size: 7px; }
.transform-panel { margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.transform-panel legend { padding: 0 5px; margin-left: -5px; }
.slider-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 18px; }
.slider-grid label { display: grid; grid-template-columns: 1fr auto; align-items: center; color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.slider-grid output { color: var(--primary); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.slider-grid input { grid-column: 1/-1; width: 100%; margin: 7px 0 0; accent-color: var(--primary); }
.preview-panel { min-width: 0; align-self: start; position: sticky; top: 98px; }
.preview-heading { margin-bottom: 9px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.preview-heading span, .preview-heading small { display: block; }
.preview-heading span { font-size: 12px; font-weight: 700; }
.preview-heading small { margin-top: 2px; color: var(--text-tertiary); font-size: 10px; }
.gizmo-toolbar { min-height: 42px; margin-bottom: 8px; padding: 4px; display: flex; align-items: center; gap: 3px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 8px; }
.gizmo-mode { min-width: 66px; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--text-secondary); background: transparent; border: 0; border-radius: 6px; font-size: 9px; font-weight: 700; transition: color var(--ease), background var(--ease), box-shadow var(--ease); }
.gizmo-mode:hover { color: var(--text); background: #fff; }.gizmo-mode.is-active { color: var(--primary); background: #fff; box-shadow: 0 1px 3px rgba(18,32,29,.1); }
.gizmo-mode:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }.gizmo-mode svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gizmo-selection { min-width: 0; margin-left: auto; padding: 0 7px; overflow: hidden; color: var(--text-tertiary); font-size: 8px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.live-indicator { display: inline-flex !important; align-items: center; gap: 6px; color: var(--success); font-size: 10px !important; }
.viewport-3d-box { height: 382px; position: relative; overflow: hidden; background: #17211f; border: 1px solid #25332f; border-radius: var(--radius-sm); }
.viewport-canvas { width: 100%; height: 100%; display: block; }
.viewport-overlay { position: absolute; left: 10px; bottom: 10px; padding: 4px 7px; color: #bfcbc7; background: rgba(10,16,14,.65); border: 1px solid rgba(255,255,255,.09); border-radius: 5px; font-size: 9px; pointer-events: none; }
.modal-footer { min-height: 72px; padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-top: 1px solid var(--border); position: sticky; bottom: 0; z-index: 4; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); }
.footer-actions { margin-left: auto; display: flex; gap: 8px; }
.confirm-body { padding: 24px 22px; display: flex; align-items: flex-start; gap: 14px; }
.confirm-body p { margin: 1px 0 0; color: var(--text-secondary); font-size: 13px; }
.danger-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: var(--danger); background: var(--danger-soft); border-radius: 9px; }
.danger-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.qr-modal-body { padding: 24px 22px; text-align: center; }
.qr-modal-body > p { margin-bottom: 18px; color: var(--text-secondary); font-size: 13px; }
.qr-box { width: 212px; min-height: 212px; margin: 0 auto 16px; padding: 16px; display: grid; place-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr-box img, .qr-box canvas { max-width: 100%; height: auto; }
.qr-url-text { display: block; margin-bottom: 14px; padding: 9px 10px; overflow-wrap: anywhere; color: var(--primary); background: var(--surface-muted); border-radius: 6px; font-size: 10px; }

.toast-container { position: fixed; z-index: 300; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast { max-width: 360px; min-height: 44px; padding: 10px 13px; display: flex; align-items: center; gap: 9px; color: white; background: #17211f; border-radius: 8px; box-shadow: var(--shadow-md); font-size: 12px; animation: toast-in 180ms ease-out; }
.toast.danger { background: #7f1d1d; }
.toast svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 980px) {
  .marker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; grid-row: 1; }
  .viewport-3d-box { height: 300px; }
}
@media (max-width: 700px) {
  .topbar { height: 64px; padding: 0 16px; }
  .brand small { display: none; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { width: 42px; padding: 0; }
  .workspace { width: min(calc(100% - 32px), var(--max-width)); padding-top: 30px; }
  .page-heading { align-items: flex-start; }
  .page-heading > div { min-width: 0; }
  .page-heading p:last-child { max-width: 230px; }
  .status-strip { grid-template-columns: 1fr; }
  .status-item + .status-item { border-left: 0; border-top: 1px solid var(--border); }
  .library-toolbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .search-field { width: 100%; }
  .marker-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; place-items: stretch; }
  .modal { width: 100%; max-height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; }
  .modal-small { width: 100%; min-height: 0; align-self: end; border-radius: 16px 16px 0 0; }
  .editor-layout { padding: 18px 16px; gap: 20px; }
  .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .upload-grid, .slider-grid { grid-template-columns: 1fr; }
  .module-type-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gizmo-mode { min-width: 44px; width: 44px; padding: 0; }.gizmo-mode span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .modal-footer { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .toast-container { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}
@media (max-width: 470px) {
  .page-heading { display: block; }
  .page-heading .btn { width: 100%; margin-top: 20px; }
  .marker-preview { height: 176px; }
  .footer-actions { width: 100%; }
  .footer-actions .btn { flex: 1; }
  #btnDeleteFromModal:not([hidden]) { width: 40px; padding: 0; font-size: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
