/* ════════════════════════════════════════════
   Teasy Website Editor — Stylesheet
   Desktop: three columns.  Phone (≤900px): full-width page,
   bottom dock, slide-up sheets.
   ════════════════════════════════════════════ */

:root {
    --ink: #17142e;
    --ink-2: #4b5069;
    --ink-3: #868ba1;
    --line: #e6e8f1;
    --line-2: #f1f3f9;
    --canvas: #e9ecf5;
    --panel: #ffffff;
    --brand: #4f46e5;
    --brand-2: #6366f1;
    --brand-soft: #eef0ff;
    --brand-line: #c7d0fb;
    --danger: #dc2626;
    --header-h: 56px;
    --dock-h: 60px;
    --sheet-h: min(54vh, 480px);
}
@supports (height: 1dvh) { :root { --sheet-h: min(54dvh, 480px); } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: #f1f3f9; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5e0; border-radius: 99px; }

.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mobile-only-inline { display: none; }

/* ════ APP SHELL ════ */
.app-shell {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    overflow: hidden; background: var(--canvas);
}
.workspace { flex: 1; min-height: 0; display: flex; position: relative; }

/* ════ HEADER ════ */
.teasy-header {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    padding: 0 20px; height: var(--header-h);
    background: var(--panel); border-bottom: 1px solid var(--line);
    flex-shrink: 0; z-index: 30; position: relative; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.logo-mark {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-size: 16px; font-weight: 800; letter-spacing: -.4px; }
.logo-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.header-tools { display: flex; align-items: center; gap: 4px; }
.header-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.divider { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; min-width: 36px; padding: 0 10px; border-radius: 9px;
    background: transparent; border: 0; color: var(--ink-2);
    font-size: 13px; font-weight: 500; white-space: nowrap;
    transition: background .12s, color .12s, transform .1s;
}
.icon-btn:hover:not(:disabled) { background: var(--line-2); color: var(--ink); }
.icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.icon-btn.sm { height: 32px; min-width: 32px; padding: 0 6px; }
.icon-btn.danger:hover:not(:disabled) { background: #fef2f2; color: var(--danger); }

.device-switch { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg { width: 34px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); display: flex; align-items: center; justify-content: center; transition: background .12s, color .12s; }
.seg:hover { color: var(--ink); }
.seg.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(23,20,46,.12); }

.btn-primary {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
    border: 0; border-radius: 10px; font-size: 13.5px; font-weight: 650;
    color: #fff; background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 2px 10px rgba(79,70,229,.35); transition: opacity .15s, transform .1s;
}
.btn-primary:hover { opacity: .92; }
.btn-primary:active { transform: scale(.97); }
.btn-primary .short { display: none; }

.change-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px;
    font-size: 12px; font-weight: 600; background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
}
.change-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ════ BUTTONS (shared) ════ */
.btn-solid, .btn-soft {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
    font-size: 13px; font-weight: 600; transition: background .12s, transform .1s, border-color .12s;
}
.btn-solid { background: var(--brand-2); color: #fff; }
.btn-solid:hover { background: var(--brand); }
.btn-soft { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-soft:hover { background: var(--line-2); color: var(--ink); }
.btn-solid:active, .btn-soft:active { transform: scale(.98); }
.btn-solid.wide, .btn-soft.wide { width: 100%; }
.btn-solid.big, .btn-soft.big { height: 46px; font-size: 14.5px; width: 100%; border-radius: 12px; }
.btn-solid.big { box-shadow: 0 4px 14px rgba(99,102,241,.32); }
.link-btn { background: none; border: 0; color: var(--ink-3); font-size: 12px; text-decoration: underline; padding: 6px; }
.link-btn:hover { color: var(--danger); }
.fine-print { font-size: 11.5px; line-height: 1.5; color: var(--ink-3); margin-top: 8px; }
.fine-print.center { text-align: center; }
.fine-link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--brand); text-decoration: none; }
.fine-link:hover { text-decoration: underline; }

/* ════ LEFT SIDEBAR ════ */
.left-sidebar {
    width: 276px; flex-shrink: 0; background: var(--panel);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-scroll { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.sidebar-section { padding: 16px; border-bottom: 1px solid var(--line); }
.section-label { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 10px; letter-spacing: -.1px; }
.field-label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 500; margin: 14px 0 6px; }

.drop-zone {
    border: 2px dashed #cdd3e6; border-radius: 14px; padding: 18px 12px;
    text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone:focus-visible { border-color: var(--brand-2); background: #f6f7ff; }
.drop-zone.drag-over { border-color: var(--brand-2); background: var(--brand-soft); }
.drop-icon {
    width: 44px; height: 44px; border-radius: 12px; background: var(--line-2); color: var(--ink-3);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
    transition: background .15s, color .15s;
}
.drop-zone:hover .drop-icon { background: var(--brand-soft); color: var(--brand-2); }
.drop-title { font-size: 14px; font-weight: 650; }
.drop-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.paste-area {
    width: 100%; font-size: 12px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; resize: none; outline: none;
    color: var(--ink); background: #f8f9fc; line-height: 1.5; margin-bottom: 8px;
}
.paste-area:focus { border-color: #a5b8fc; box-shadow: 0 0 0 3px rgba(99,102,241,.12); background: #fff; }

.fr-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--brand-2); }
.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-row .btn-soft { padding: 0 8px; font-size: 12.5px; }

#element-tree { display: flex; flex-direction: column; gap: 1px; }
.tree-empty { font-size: 12px; color: var(--ink-3); line-height: 1.5; padding: 2px; }
.tree-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
    cursor: pointer; font-size: 12px; color: var(--ink-2); user-select: none; transition: background .1s;
}
.tree-item:hover { background: var(--line-2); }
.tree-item.selected { background: var(--brand-soft); color: var(--brand); }
.tree-tag {
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px; font-weight: 700;
    background: var(--line-2); color: #6b7280; padding: 1px 6px; border-radius: 5px; flex-shrink: 0;
}
.tree-item.selected .tree-tag { background: var(--brand-line); color: #3730a3; }
.tree-text { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tree-item.selected .tree-text { color: var(--brand-2); }

.sidebar-history { padding: 14px 16px 18px; background: #f8f9fc; }
.history-items { display: flex; flex-direction: column; gap: 4px; max-height: 110px; overflow-y: auto; }
.history-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.history-dot { width: 5px; height: 5px; border-radius: 50%; background: #a5b8fc; flex-shrink: 0; }

.sheet-handle { display: none; }

/* ════ PREVIEW AREA ════ */
.preview-container {
    flex: 1; min-width: 0; position: relative; overflow: auto; padding: 24px; overscroll-behavior: contain;
    display: flex; align-items: flex-start; justify-content: center;
    background: var(--canvas); background-image: radial-gradient(circle, #d3d8e8 1px, transparent 1px); background-size: 22px 22px;
}
.empty-state {
    position: absolute; inset: 0; z-index: 10; padding: 20px; overflow-y: auto; overscroll-behavior: contain;
    display: flex; align-items: center; justify-content: center;
    background: var(--canvas); background-image: radial-gradient(circle, #d3d8e8 1px, transparent 1px); background-size: 22px 22px;
}
.empty-card {
    background: #fff; border-radius: 20px; padding: 36px 32px 28px; text-align: center;
    box-shadow: 0 8px 40px rgba(23,20,46,.1); max-width: 400px; width: 100%; margin: auto;
}
.empty-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-2); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.empty-title { font-size: 21px; font-weight: 750; letter-spacing: -.4px; margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 22px; }
.empty-actions { display: flex; flex-direction: column; gap: 10px; }
.restore-wrap { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.btn-restore {
    width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px;
    border: 1px solid var(--brand-line); background: var(--brand-soft); color: #3730a3; border-radius: 12px;
    font-size: 14px; font-weight: 650;
}
.btn-restore small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-top: 1px; }
.btn-restore:hover { background: #e4e8ff; }

.preview-wrapper {
    background: #fff; border-radius: 12px; overflow: hidden; width: 100%;
    box-shadow: 0 6px 30px rgba(23,20,46,.14), 0 1px 4px rgba(23,20,46,.06);
    transition: max-width .35s cubic-bezier(.4,0,.2,1), border-radius .35s;
}
.preview-wrapper[data-device="tablet"] { max-width: 788px; border: 10px solid #1c1c1e; border-radius: 26px; }
.preview-wrapper[data-device="phone"]  { max-width: 414px; border: 12px solid #1c1c1e; border-radius: 40px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.device-chrome { background: #1c1c1e; display: flex; align-items: center; justify-content: center; padding: 8px 0; }
.device-bar { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 16px; }
.device-dots { display: flex; gap: 5px; }
.device-dots span { width: 8px; height: 8px; border-radius: 50%; background: #3a3a3c; }
.device-notch { width: 80px; height: 18px; background: #000; border-radius: 99px; }
.preview-iframe { width: 100%; border: 0; display: block; min-height: 500px; background: #fff; }

/* ════ RIGHT PANEL ════ */
.right-panel {
    width: 300px; flex-shrink: 0; background: var(--panel); border-left: 1px solid var(--line);
    display: flex; flex-direction: column; overflow: hidden;
}
.no-selection-state { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px; text-align: center; }
.no-sel-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-2); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.no-sel-title { font-size: 16px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 6px; }
.no-sel-sub { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin-bottom: 18px; }
.no-sel-tips { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.tip-item { display: flex; align-items: center; gap: 11px; background: #f8f9fc; border-radius: 10px; padding: 10px 12px; text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 500; line-height: 1.4; }
.tip-item .ic { color: var(--brand-2); }

.props-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.props-header { padding: 12px 12px 10px 16px; background: #f6f7ff; border-bottom: 1px solid #e3e7fb; flex-shrink: 0; }
.props-header-inner { display: flex; align-items: center; gap: 8px; }
.tag-pill { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; font-weight: 700; background: var(--brand-2); color: #fff; padding: 3px 9px; border-radius: 7px; flex-shrink: 0; }
.tag-classes { font-size: 11.5px; color: var(--ink-3); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-row { display: flex; align-items: center; margin-left: auto; flex-shrink: 0; }
.props-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

.inspector-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; background: #fff; }
.itab { flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; transition: background .12s, color .12s; }
.itab:hover { background: var(--line-2); }
.itab.active { background: var(--brand-soft); color: var(--brand); }
.props-scroll { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }

.prop-group { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.prop-group-label { font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }
.prop-label { display: block; font-size: 12px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.stack > * + * { margin-top: 12px; }
.prop-input, .prop-select, .prop-textarea {
    width: 100%; font-size: 13.5px; border: 1px solid var(--line); border-radius: 10px;
    padding: 8px 11px; outline: none; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.prop-input:focus, .prop-select:focus, .prop-textarea:focus { border-color: #a5b8fc; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.prop-textarea { resize: vertical; line-height: 1.5; }
.prop-textarea:disabled { background: #f4f5fa; color: var(--ink-3); resize: none; }
.prop-select { cursor: pointer; }
.prop-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.align-group { display: flex; gap: 4px; }
.align-btn { flex: 1; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-3); display: flex; align-items: center; justify-content: center; transition: all .12s; }
.align-btn:hover { background: #f6f7ff; color: var(--brand); }
.align-btn.active { background: var(--brand-soft); border-color: #a5b8fc; color: var(--brand); }

.color-row { display: flex; align-items: center; gap: 8px; }
.color-swatch-wrap { position: relative; flex-shrink: 0; cursor: pointer; }
.color-native { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.color-swatch { display: block; width: 38px; height: 38px; border-radius: 10px; border: 2px solid var(--line); }
.color-hex-input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.clear-btn { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.clear-btn:hover { background: #fee2e2; color: var(--danger); }

.spacing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.spacing-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.spacing-label { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.spacing-input { width: 100%; padding: 7px 2px; text-align: center; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #f8f9fc; }
.spacing-input:focus { border-color: #a5b8fc; background: #fff; }

.opacity-slider { width: 100%; height: 6px; border-radius: 99px; -webkit-appearance: none; appearance: none; background: linear-gradient(to right, #e6e8f1, var(--brand-2)); outline: none; margin: 8px 0 4px; cursor: pointer; }
.opacity-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-2); box-shadow: 0 1px 4px rgba(99,102,241,.3); }
.opacity-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--brand-2); }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); }

.img-preview-wrap { margin-bottom: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.img-thumb { width: 100%; height: 90px; object-fit: cover; display: block; }
.img-replace-btn { width: 100%; height: 44px; border-radius: 10px; border: 2px dashed #a5b8fc; background: #f6f7ff; color: #3730a3; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.img-replace-btn:hover { background: var(--brand-soft); border-color: var(--brand-2); }

/* ════ DOCK (phones only) ════ */
.dock { display: none; }

/* ════ STATUS BAR ════ */
.status-bar { height: 28px; background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0; }
.status-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #d1d5e0; flex-shrink: 0; transition: background .3s; }
.status-dot.active { background: #10b981; }
#status-msg { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-tag { font-size: 11.5px; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink-3); }

/* ════ TOASTS ════ */
.toast-container { position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: 0 6px 24px rgba(23,20,46,.14); animation: toastIn .25s cubic-bezier(.34,1.56,.64,1); pointer-events: auto; max-width: 340px; }
.toast.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.toast.error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast.info    { background: #f0f4ff; color: var(--ink); border: 1px solid var(--brand-line); }
.toast.removing { animation: toastOut .2s ease forwards; }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.toast.success .toast-icon { background: #a7f3d0; color: #065f46; }
.toast.error   .toast-icon { background: #fecaca; color: #991b1b; }
.toast.info    .toast-icon { background: var(--brand-line); color: var(--ink); }
@keyframes toastIn  { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: scale(.95); } }

/* ════ ACCESSIBILITY: visually hidden but readable by screen readers & search engines ════ */
.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; }

/* ════════════════════════════════════════════
   PHONES & SMALL TABLETS  (≤ 900px)
   ════════════════════════════════════════════ */
@media (max-width: 900px) {
    :root { --header-h: 52px; }
    .desktop-only { display: none !important; }
    .mobile-only-inline { display: inline; }
    .status-bar { display: none; }

    .teasy-header { display: flex; padding: 0 10px; gap: 4px; }
    .logo-sub, .btn-label, .change-badge { display: none; }
    .logo-mark { width: 32px; height: 32px; }
    .header-tools { margin-left: auto; }
    .header-end { margin-left: 4px; }
    .icon-btn { height: 40px; min-width: 40px; }
    .btn-primary { height: 40px; padding: 0 16px; }
    .btn-primary .long { display: none; }
    .btn-primary .short { display: inline; }

    .preview-container { padding: 0; background-image: none; background: #fff; align-items: stretch; -webkit-overflow-scrolling: touch; }
    .empty-state { background: var(--canvas); }
    .preview-wrapper, .preview-wrapper[data-device] { max-width: none !important; width: 100%; border: 0 !important; border-radius: 0 !important; box-shadow: none; min-height: 100%; }
    .device-chrome { display: none !important; }
    .app-shell.sheet-open .preview-container { padding-bottom: var(--sheet-h); }

    /* sheets */
    .left-sidebar, .right-panel {
        position: fixed; left: 0; right: 0; width: auto; z-index: 40;
        bottom: calc(var(--dock-h) + env(safe-area-inset-bottom));
        height: var(--sheet-h);
        border: 0; border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(23,20,46,.18);
        transform: translateY(calc(100% + var(--dock-h) + 30px)); visibility: hidden;
        transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s;
    }
    .left-sidebar.open, .right-panel.open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1); }
    .sheet-handle { display: block; flex-shrink: 0; height: 22px; position: relative; cursor: pointer; }
    .sheet-handle::after { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: #d3d7e6; }
    .left-sidebar.tab-file .group-layers { display: none; }
    .left-sidebar.tab-layers .group-file { display: none; }
    .sidebar-section { padding: 14px 16px; }
    .no-selection-state { justify-content: flex-start; padding: 16px; }
    .no-sel-icon { display: none; }

    /* bigger touch targets; 16px inputs stop iOS from zooming on focus */
    .prop-input, .prop-select, .prop-textarea, .paste-area, .spacing-input, .color-hex-input { font-size: 16px; }
    .prop-input, .prop-select { height: 44px; }
    .prop-textarea { min-height: 88px; }
    .spacing-input { height: 44px; }
    .btn-solid, .btn-soft { height: 44px; }
    .align-btn { height: 44px; }
    .color-swatch { width: 44px; height: 44px; }
    .tree-item { padding: 11px 10px; font-size: 13px; }
    .tree-text { font-size: 13px; }
    .icon-btn.sm { height: 38px; min-width: 36px; padding: 0 5px; }
    .itab { height: 40px; }
    .tag-classes { display: none; }
    .props-header { padding: 4px 8px 8px 14px; }
    .props-hint { display: none; }
    .opacity-slider { height: 8px; }

    /* dock */
    .dock {
        display: flex; flex-shrink: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line);
        height: calc(var(--dock-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    }
    .dock-tab {
        flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        background: none; border: 0; color: var(--ink-3); font-size: 11.5px; font-weight: 600;
    }
    .dock-tab.active { color: var(--brand); }
    .dock-tab.active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: var(--brand-2); }
    .dock-dot { position: absolute; top: 9px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); border: 2px solid #fff; box-sizing: content-box; }

    .toast-container { top: calc(var(--header-h) + 8px); bottom: auto; }
    .toast { max-width: 100%; }

    .empty-card { padding: 28px 20px 22px; border-radius: 18px; }

    /* once a page is open, the editor owns the screen: nothing behind it can scroll into view */
    html.editor-active, body.editor-active { overflow: hidden; overflow: clip; overscroll-behavior: none; }
    body.editor-active { position: fixed; inset: 0; width: 100%; }
    .app-shell { overflow: hidden; overflow: clip; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ════ "DONE FOR YOU" OFFER ════ */
.side-note { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); margin-bottom: 10px; }
.offer-backdrop {
    position: fixed; inset: 0; z-index: 9000; padding: 20px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(23,20,46,.45);
    animation: offerFade .18s ease-out;
}
.offer-backdrop.hidden { display: none !important; }
.offer-card {
    position: relative; width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto;
    background: #fff; border-radius: 20px; padding: 28px 26px 22px;
    box-shadow: 0 24px 70px rgba(23,20,46,.35);
    animation: offerRise .24s cubic-bezier(.2,.8,.2,1);
}
.offer-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); display: flex; align-items: center; justify-content: center; }
.offer-close:hover { background: var(--line-2); color: var(--ink); }
.offer-title { font-size: 21px; font-weight: 750; letter-spacing: -.4px; color: var(--ink); margin: 0 28px 6px 0; line-height: 1.25; }
.offer-sub { font-size: 14px; line-height: 1.6; color: var(--ink-2); margin-bottom: 14px; }
.offer-price { display: inline-block; font-size: 13px; font-weight: 650; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 99px; margin-bottom: 14px; }
.offer-gap { margin-top: 12px; }
.offer-include { margin-top: 12px; align-items: flex-start; line-height: 1.4; }
.offer-include input { margin-top: 2px; flex-shrink: 0; }
.offer-include.is-disabled { opacity: .6; }
.offer-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.offer-error { margin-top: 12px; font-size: 13px; line-height: 1.5; color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 9px 12px; }
.offer-error a { color: #991b1b; font-weight: 600; }
.offer-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; }
.offer-actions .btn-solid, .offer-actions .btn-soft { width: 100%; text-decoration: none; }
.offer-actions .btn-solid:disabled { opacity: .6; cursor: progress; }
.offer-tick { width: 52px; height: 52px; border-radius: 50%; background: #ecfdf5; color: #059669; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.offer-tick .ic { width: 26px; height: 26px; stroke-width: 2.5; }
#offer-done-view .btn-solid { margin-top: 4px; }
@keyframes offerFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes offerRise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
    .offer-backdrop { padding: 0; align-items: flex-end; }
    .offer-card {
        max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0;
        padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
        animation: offerSlide .28s cubic-bezier(.2,.8,.2,1);
    }
    .offer-title { font-size: 20px; margin-right: 40px; }
    .offer-close { width: 44px; height: 44px; top: 8px; right: 8px; }
    @keyframes offerSlide { from { transform: translateY(100%); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) { .offer-backdrop, .offer-card { animation: none; } }

[hidden] { display: none !important; }
.seo-content .seo-offer { margin-top: 40px; padding: 22px 22px 20px; border: 1px solid var(--brand-line); background: var(--brand-soft); border-radius: 16px; }
.seo-content .seo-offer h2 { margin: 0 0 6px; font-size: 19px; }
.seo-content .seo-offer p { margin-bottom: 14px; }
.seo-offer .btn-solid { width: auto; padding: 0 20px; }
.seo-offer-link { margin-left: 14px; font-size: 14px; color: var(--brand); }
@media (max-width: 600px) {
    .seo-offer .btn-solid { width: 100%; }
    .seo-offer-link { display: block; margin: 14px 0 0; text-align: center; }
}
.dfy-cta { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 18px 0 6px; }
.dfy-cta a { text-decoration: none; }
.dfy-note { font-size: 14px; color: var(--ink-2); background: #f8f9fc; border-radius: 10px; padding: 12px 14px; }
/* ════ SEO CONTENT SECTION (below the app) ════ */
.seo-content { background: #fff; border-top: 1px solid var(--line); padding: 56px 20px 40px; }
.seo-inner { max-width: 760px; margin: 0 auto; }
.seo-content h2 { font-size: 21px; font-weight: 800; color: #1e1b4b; letter-spacing: -.3px; margin: 40px 0 14px; }
.seo-content h2:first-child { margin-top: 0; }
.seo-content p { font-size: 14.5px; line-height: 1.75; color: #4b5563; margin-bottom: 4px; }
.seo-feature-list { list-style: none; padding: 0; margin: 4px 0 0; }
.seo-feature-list li { font-size: 14px; line-height: 1.7; color: #4b5563; padding: 7px 0 7px 22px; border-bottom: 1px solid var(--line-2); position: relative; }
.seo-feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--brand-2); font-weight: 800; }
.seo-feature-list li strong { color: #1e1b4b; }
.seo-faq { margin-top: 8px; }
.seo-faq-item { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.seo-faq-item h3 { font-size: 15px; font-weight: 700; color: #1e1b4b; margin-bottom: 6px; }
.seo-faq-item p { font-size: 14px; color: #6b7280; margin: 0; }
.seo-footer { max-width: 760px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; }
.seo-footer p { font-size: 12px; color: #9ca3af; }
.seo-links { list-style: none; padding: 0; margin: 4px 0 0; }
.seo-links li { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.seo-links a, .seo-crumbs a, .seo-footer a { color: var(--brand); text-decoration: none; }
.seo-links a:hover, .seo-crumbs a:hover, .seo-footer a:hover { text-decoration: underline; }
.seo-crumbs { font-size: 12.5px; color: #9ca3af; margin-bottom: 18px; }
.seo-steps { padding-left: 22px; margin: 4px 0 0; }
.seo-steps li { font-size: 14px; line-height: 1.7; color: #4b5563; padding: 5px 0; }
.guides-page { min-height: 100vh; background: #fff; padding: 56px 20px; }
