/* Lawha (لوحة) — site and editor styles. Font faces for the text tool are generated by build.mjs into fonts.css. */
@font-face { font-family: 'Readex Pro'; font-weight: 160 700; font-display: swap; src: url(/fonts/readex-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Readex Pro'; font-weight: 160 700; font-display: swap; src: url(/fonts/readex-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Readex Pro'; font-weight: 160 700; font-display: swap; src: url(/fonts/readex-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: 'Readex Pro'; font-weight: 160 700; font-display: swap; src: url(/fonts/readex-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Readex Pro'; font-weight: 160 700; font-display: swap; src: url(/fonts/manrope-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Readex Pro'; font-weight: 160 700; font-display: swap; src: url(/fonts/noto-devanagari.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF; }
/* Persian and Urdu: Readex Pro's Arabic subset has no ی ک گ پ چ ژ, so those pages use Vazirmatn (OFL). */
@font-face { font-family: 'Vazirmatn UI'; font-weight: 100 900; font-display: swap; src: url(/fonts/vazirmatn-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
  --brand: #6d5efc; --brand-2: #8b7dff; --brand-ink: #fff; --accent: #ffd166;
  --bg: #f7f6fb; --surface: #ffffff; --surface-2: #f0eef8; --ink: #17151f; --muted: #5d5a6b; --line: #e4e1ef;
  --radius: 14px; --gutter: 16px; --shadow: 0 10px 30px rgba(30, 20, 80, .08);
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}
:root:lang(fa), :root:lang(ur) { --font: 'Vazirmatn UI', 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; }
:root:lang(ja) { --font: 'Readex Pro', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', Meiryo, 'Noto Sans JP', system-ui, sans-serif; line-break: strict; }
:root:lang(ko) { --font: 'Readex Pro', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif; word-break: keep-all; }
:root:lang(zh) { --font: 'Readex Pro', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif; line-break: strict; }
:root:is(:lang(ja), :lang(ko), :lang(zh)) :is(h1, h2, h3) { letter-spacing: 0; word-break: auto-phrase; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f0e15; --surface: #17161f; --surface-2: #1f1d2a; --ink: #f1effa; --muted: #a7a3b8; --line: #2c2a3a; --shadow: 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0f0e15; --surface: #17161f; --surface-2: #1f1d2a; --ink: #f1effa; --muted: #a7a3b8; --line: #2c2a3a; --shadow: 0 10px 30px rgba(0, 0, 0, .35); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--font); }
a { color: var(--brand); }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.wrap { width: min(1120px, 100% - var(--gutter) * 2); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* ---------- site header and footer ---------- */
.site-top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.logo svg { width: 32px; height: 32px; }
.logo small { font-weight: 500; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.site-top nav { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.site-top nav a { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.site-top nav a:hover { background: var(--surface-2); }
.lang-sel { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 8px; font-size: .9rem; }
.lang-pick { position: relative; }
.lang-pick summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.lang-pick summary::-webkit-details-marker { display: none; }
.lang-pick summary::after { content: ' ▾'; color: var(--muted); }
.lang-pick summary:hover, .lang-pick[open] summary { background: var(--surface-2); }
.lang-list { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; display: grid; grid-template-columns: repeat(2, auto); gap: 2px 8px; padding: 6px 8px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.lang-list a { padding: 6px 10px !important; white-space: nowrap; }
.lang-list a[aria-current] { color: var(--brand) !important; font-weight: 600; }
.foot-langs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; }
footer.site { border-top: 1px solid var(--line); margin-top: 64px; padding: 32px 0; color: var(--muted); font-size: .92rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
footer.site a { color: var(--muted); }

/* ---------- landing ---------- */
.hero { padding: 40px 0 8px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: clamp(1rem, 2.4vw, 1.2rem); color: var(--muted); max-width: 720px; margin: 0 auto 24px; }
.drop { position: relative; border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--surface); border-radius: 22px; padding: 36px 20px; text-align: center; box-shadow: var(--shadow); transition: .15s; }
.drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); transform: scale(1.01); }
.drop h2 { margin: 8px 0 4px; font-size: 1.35rem; }
.drop .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 10px; }
.drop .art { width: 72px; height: 72px; margin: 0 auto; }
.badges { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; color: var(--muted); font-size: .9rem; margin-top: 14px; }
.badges span::before { content: '✓ '; color: #22a06b; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 10px 18px; cursor: pointer; font-weight: 600; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-lg { padding: 14px 26px; font-size: 1.08rem; border-radius: 14px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 28px 0; }
.tcard { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: .15s; }
.tcard:hover { border-color: var(--brand); transform: translateY(-1px); }
.tcard .ti { flex: none; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand); display: grid; place-items: center; }
.tcard .ti svg { width: 22px; height: 22px; }
.tcard b { display: block; font-size: .98rem; }
.tcard small { color: var(--muted); font-size: .82rem; line-height: 1.4; display: block; }
.seo { display: grid; gap: 28px; margin-top: 36px; }
.seo h2 { font-size: 1.4rem; margin: 0 0 10px; }
.seo ol { padding-inline-start: 22px; } .seo li { margin: 6px 0; }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.feat h3 { margin: 0 0 6px; font-size: 1.02rem; }
.feat p { margin: 0; color: var(--muted); font-size: .94rem; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; }
.crumbs { font-size: .88rem; color: var(--muted); margin-top: 18px; }
.crumbs a { color: var(--muted); }
.prose { max-width: 760px; }
html.editing body { overflow: hidden; }
html.editing body > :not(#lw-editor):not(dialog) { visibility: hidden; }

/* ---------- editor workspace (always dark, laid out like desktop photo editors) ---------- */
.ed { --e-bg: #1c1c21; --e-canvas: #131317; --e-panel: #26262c; --e-panel-2: #303037; --e-line: #3a3a43; --e-ink: #e8e8ee; --e-muted: #9c9ca8; --e-hover: #383841;
  position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: 34px 40px minmax(0, 1fr) 24px; grid-template-columns: minmax(0, 1fr); background: var(--e-bg); color: var(--e-ink); color-scheme: dark; font-size: 12.5px; line-height: 1.4; user-select: none; -webkit-user-select: none; }
.ed[hidden] { display: none; }
.ed button { cursor: pointer; font-size: inherit; }
.ed input, .ed select, .ed textarea { user-select: text; -webkit-user-select: text; }
.ed svg { width: 17px; height: 17px; flex: none; }
.ib { display: inline-grid; place-items: center; width: 30px; height: 30px; background: none; border: 0; border-radius: 6px; color: var(--e-ink); flex: none; }
.ib:hover { background: var(--e-hover); } .ib.on { background: var(--brand); color: #fff; }
.ib:disabled { opacity: .35; cursor: default; background: none; }
.ed .sep { width: 1px; height: 20px; background: var(--e-line); margin: 0 4px; display: inline-block; flex: none; }
.ed .btn { background: var(--e-panel-2); border: 1px solid var(--e-line); color: var(--e-ink); font-size: 12.5px; padding: 6px 12px; min-height: 30px; border-radius: 7px; font-weight: 600; }
.ed .btn:hover { border-color: #55555f; } .ed .btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ed .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.ed .btn.sm { padding: 3px 10px; min-height: 26px; }
.ed input[type="number"], .ed input[type="text"], .ed select, .ed textarea { background: var(--e-panel-2); border: 1px solid var(--e-line); border-radius: 6px; padding: 4px 7px; color: var(--e-ink); min-height: 26px; }
.ed input[type="number"] { width: 62px; }
.ed input[type="color"] { width: 30px; height: 26px; border: 1px solid var(--e-line); border-radius: 6px; background: var(--e-panel-2); padding: 2px; cursor: pointer; }
.ed input[type="range"] { accent-color: var(--brand); }
.muted.small, .small { font-size: 11.5px; }

/* menu bar */
.ed-bar { display: flex; align-items: center; gap: 4px; padding: 0 6px; background: var(--e-panel); border-bottom: 1px solid #111; min-width: 0; }
.ed-logo { display: flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--e-ink); font-weight: 700; padding: 3px 6px; border-radius: 6px; flex: none; font-size: 13px; }
.ed-logo svg { width: 22px; height: 22px; }
.ed-logo:hover { background: var(--e-hover); }
.ed-menus { display: flex; gap: 0; min-width: 0; }
.menu { position: relative; }
.menu-btn { background: none; border: 0; color: var(--e-ink); padding: 5px 9px; border-radius: 5px; }
.menu-btn:hover, .menu.open > .menu-btn { background: var(--e-hover); }
.menu-all { display: none; }
.menu-pop { display: none; position: absolute; top: calc(100% + 2px); inset-inline-start: 0; min-width: 250px; background: #2d2d34; border: 1px solid #45454f; border-radius: 8px; padding: 4px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); z-index: 30; }
.menu.open > .menu-pop { display: block; }
.menu-pop .mi { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; text-align: start; background: none; border: 0; color: var(--e-ink); padding: 5px 10px; border-radius: 5px; white-space: nowrap; }
.menu-pop .mi.sub { padding: 0; display: block; position: relative; }
.menu-pop .mi.sub > button { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; color: var(--e-ink); padding: 5px 10px; border-radius: 5px; text-align: start; }
.menu-pop .mi.sub > .menu-pop { top: -5px; inset-inline-start: 100%; }
.menu-pop .mi:hover:not(:disabled), .menu-pop .mi.sub:hover > button, .menu-pop .mi.sub.open > button { background: var(--brand); color: #fff; }
.menu-pop .mi.sub:hover > .menu-pop, .menu-pop .mi.sub.open > .menu-pop { display: block; }
.menu-pop .mi:disabled { opacity: .38; cursor: default; }
.menu-pop .mi.checked > span::before { content: '✓ '; }
.menu-pop kbd { font: inherit; font-size: 11.5px; color: var(--e-muted); direction: ltr; }
.menu-pop .mi:hover kbd { color: #fff; }
.menu-pop .ar svg { width: 13px; height: 13px; } [dir="rtl"] .menu-pop .ar svg { transform: scaleX(-1); }
.menu-pop hr { border: 0; border-top: 1px solid #45454f; margin: 4px 2px; }
.ed-quick { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; flex: none; }
.ed-save { margin-inline-start: 6px; }
.ed-save svg { width: 15px; height: 15px; }

/* options bar */
.ed-opts { display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--e-panel); border-bottom: 1px solid #111; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: thin; }
.o-tool { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--e-panel-2); flex: none; }
.og { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.ol { color: var(--e-muted); } .ol.hint { font-size: 11.5px; }
.u { color: var(--e-muted); margin-inline-start: -2px; }
.ck { display: inline-flex; align-items: center; gap: 5px; flex: none; cursor: pointer; }
.ed-opts .seg { display: inline-flex; gap: 1px; background: var(--e-panel-2); border-radius: 7px; padding: 1px; flex: none; }
.ed-opts input.r { width: 110px; }
.o-fgsw { width: 22px; height: 22px; border-radius: 4px; border: 1px solid #fff; box-shadow: 0 0 0 1px #000; flex: none; }
.o-cropsize { color: var(--e-muted); min-width: 90px; }

/* body: tools | canvas | panels */
.ed-body { display: grid; grid-template-columns: 46px minmax(0, 1fr) 290px; min-height: 0; }
.ed.bare .ed-body, .ed.no-tools .ed-body { grid-template-columns: 0 minmax(0, 1fr) 0; }
.ed.bare .ed-tools, .ed.bare .ed-dock, .ed.no-tools .ed-tools, .ed.no-tools .ed-dock { display: none; }
.ed-tools { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; background: var(--e-panel); border-inline-end: 1px solid #111; overflow-y: auto; scrollbar-width: none; }
.tg { position: relative; }
.tool { position: relative; width: 34px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: none; border: 0; color: var(--e-ink); }
.tool:hover { background: var(--e-hover); } .tool.on { background: var(--brand); color: #fff; }
.tool .more { position: absolute; inset-inline-end: 3px; bottom: 3px; width: 0; height: 0; border-inline-start: 4px solid transparent; border-bottom: 4px solid currentColor; opacity: .7; }
[dir="rtl"] .tool .more { border-inline-start: 0; border-inline-end: 4px solid transparent; }
.fly { display: none; position: fixed; z-index: 35; background: #2d2d34; border: 1px solid #45454f; border-radius: 8px; padding: 4px; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); min-width: 200px; }
.tg.fly-open .fly { display: block; }
.fly button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--e-ink); padding: 6px 10px; border-radius: 5px; text-align: start; }
.fly button:hover { background: var(--brand); color: #fff; }
.fly kbd { margin-inline-start: auto; font: inherit; color: var(--e-muted); }
.colors { position: relative; width: 38px; height: 46px; margin-top: 8px; flex: none; }
.c-fg, .c-bg { position: absolute; width: 22px; height: 22px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #000; border-radius: 3px; padding: 0; }
.c-fg { inset-inline-start: 2px; top: 2px; z-index: 1; } .c-bg { inset-inline-start: 13px; top: 13px; }
.c-swap, .c-reset { position: absolute; background: none; border: 0; color: var(--e-ink); padding: 0; width: 14px; height: 14px; display: grid; place-items: center; }
.c-swap { inset-inline-end: -2px; top: 0; } .c-reset { inset-inline-start: 0; bottom: 0; }
.c-swap svg, .c-reset svg { width: 12px; height: 12px; }
.colors input[type="color"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; inset-inline-start: 0; top: 0; }

/* canvas area */
.ed-main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.ed-tabs { display: flex; gap: 1px; background: var(--e-bg); overflow-x: auto; scrollbar-width: none; min-height: 0; }
.tab { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; height: 28px; background: var(--e-panel); color: var(--e-muted); cursor: pointer; max-width: 220px; flex: none; border-top: 2px solid transparent; }
.tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.on { background: var(--e-panel-2); color: var(--e-ink); border-top-color: var(--brand); }
.tab .tx { background: none; border: 0; color: inherit; padding: 2px; border-radius: 4px; display: grid; } .tab .tx:hover { background: var(--e-hover); }
.tab .tx svg { width: 12px; height: 12px; }
.ed-stage { grid-row: 2; position: relative; overflow: hidden; background: var(--e-canvas); touch-action: none; }
.ed-stage canvas { position: absolute; inset: 0; }
.ed-stage .lw-ov { z-index: 1; touch-action: none; }
.ed .ed-text-edit { position: absolute; z-index: 3; background: transparent; border: 1px dashed rgba(124, 108, 255, .9); outline: none; padding: 0; margin: 0; min-height: 0; resize: none; overflow: hidden; white-space: pre; min-width: 8px; caret-color: #7c6cff; border-radius: 0; box-shadow: none; }
.ed .ed-text-edit::placeholder { color: currentColor; opacity: .45; }
.ed-start { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 16px; background: var(--e-canvas); }
.ed-start[hidden] { display: none; }
.st-card { background: var(--e-panel); border: 1px solid var(--e-line); border-radius: 16px; padding: 26px; width: min(560px, 100%); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.st-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; margin-bottom: 16px; }
.st-logo svg { width: 40px; height: 40px; }
.st-acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.st-acts .btn { min-height: 42px; padding: 8px 18px; font-size: 14px; }
.st-presets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.toast { position: absolute; z-index: 4; inset-inline-start: 50%; bottom: 18px; transform: translate(-50%, 20px); background: rgba(20, 20, 26, .94); color: #fff; padding: 8px 14px; border-radius: 9px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: .2s; max-width: 90%; text-align: center; border: 1px solid var(--e-line); }
[dir="rtl"] .toast { transform: translate(50%, 20px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); } [dir="rtl"] .toast.on { transform: translate(50%, 0); }

/* panels */
.ed-dock { display: flex; flex-direction: column; background: var(--e-panel); border-inline-start: 1px solid #111; min-height: 0; overflow: hidden; }
.ed-sheet-bar { display: none; }
.panel { display: flex; flex-direction: column; border-bottom: 1px solid #111; min-height: 0; }
.panel > header { flex: none; background: var(--e-panel-2); }
.ph { display: flex; align-items: center; gap: 7px; width: 100%; background: none; border: 0; color: var(--e-ink); padding: 6px 10px; font-weight: 600; text-align: start; }
.ph svg { width: 14px; height: 14px; color: var(--e-muted); }
.panel .pb { padding: 8px 10px; overflow: auto; min-height: 0; }
.panel.collapsed .pb { display: none; }
.ed.no-props .p-props, .ed.no-history .p-history, .ed.no-layers .p-layers { display: none; }
.p-props .pb { max-height: 42vh; }
.p-history { flex: 0 1 auto; } .p-history .pb { max-height: 22vh; }
.p-layers { flex: 1 1 auto; min-height: 200px; } .p-layers .pb { display: flex; flex-direction: column; flex: 1; padding: 6px 6px 0; }
.p-layers.collapsed { flex: 0 0 auto; min-height: 0; }
.props-body h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--e-muted); margin: 4px 0 8px; }
.xywh { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.xywh label { display: flex; align-items: center; gap: 5px; color: var(--e-muted); }
.xywh input { width: 100%; }
.field { display: grid; gap: 3px; margin: 0 0 9px; color: var(--e-muted); }
.field b { color: var(--e-ink); font-weight: 600; }
.field input[type="range"] { width: 100%; }
.props-body textarea { width: 100%; font-size: 14px; margin-bottom: 8px; resize: vertical; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; } .row > .field { flex: 1; min-width: 70px; }
.row.sticky { position: sticky; bottom: -8px; background: var(--e-panel); padding: 8px 0 2px; }
.check { display: flex; align-items: center; gap: 7px; margin: 5px 0; color: var(--e-ink); }
.check input[type="color"] { margin-inline-start: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { background: var(--e-panel-2); border: 1px solid var(--e-line); border-radius: 99px; padding: 4px 10px; color: var(--e-ink); display: inline-flex; gap: 6px; align-items: baseline; }
.chip small { color: var(--e-muted); font-size: 11px; } .chip.on, .chip:hover { border-color: var(--brand); }
.chip.on { background: color-mix(in srgb, var(--brand) 30%, var(--e-panel-2)); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.grid2 .btn { justify-content: flex-start; }
.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.look { background: none; border: 2px solid transparent; border-radius: 8px; padding: 2px; color: var(--e-ink); font-size: 11px; display: grid; gap: 2px; justify-items: center; }
.look canvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: 5px; background: #000; }
.look.on { border-color: var(--brand); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 5px; cursor: pointer; }
.hist li svg { width: 13px; height: 13px; color: var(--e-muted); }
.hist li:hover { background: var(--e-hover); } .hist li.on { background: color-mix(in srgb, var(--brand) 35%, var(--e-panel)); }
.hist li.future { opacity: .45; }
.layer-opts { display: flex; gap: 6px; align-items: center; padding: 0 2px 6px; }
.layer-opts select { flex: 1; min-width: 0; }
.l-op { display: flex; align-items: center; gap: 4px; color: var(--e-muted); } .l-op input { width: 52px; }
.layer-opts.off { opacity: .4; pointer-events: none; }
.layer-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 60px; }
.layer { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.layer:hover { background: var(--e-hover); } .layer.on { background: color-mix(in srgb, var(--brand) 26%, var(--e-panel)); border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.layer.dragging { opacity: .4; } .layer.drop-above { box-shadow: inset 0 2px 0 var(--brand); } .layer.drop-below { box-shadow: inset 0 -2px 0 var(--brand); }
.layer .eye { width: 24px; height: 24px; } .layer .eye svg { width: 14px; height: 14px; }
.layer .thumb { width: 36px; height: 36px; border-radius: 3px; background: repeating-conic-gradient(#4a4a54 0 25%, #36363e 0 50%) 0 0 / 8px 8px; flex: none; outline: 1px solid #111; }
.layer .thumb.tgt { outline: 2px solid #fff; }
.layer .mthumb { background: #000; } .layer .mthumb.off { opacity: .4; }
.layer .lname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.layer .kind { color: var(--e-muted); font-size: 12px; } .layer .kind svg { width: 13px; height: 13px; }
.layer-foot { display: flex; justify-content: flex-end; gap: 2px; padding: 4px 0; border-top: 1px solid var(--e-line); margin-top: 4px; }
.layer-foot .ib { width: 28px; height: 28px; } .layer-foot svg { width: 15px; height: 15px; }

/* status bar */
.ed-status { display: flex; align-items: center; gap: 16px; padding: 0 10px; background: var(--e-panel); border-top: 1px solid #111; color: var(--e-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.ed-status .zoom-in { width: 64px; min-height: 18px; padding: 0 5px; font-size: 11.5px; }
.st-hint { overflow: hidden; text-overflow: ellipsis; }
.show-sm { display: none !important; }

/* dialogs */
.dlg { border: 1px solid #45454f; border-radius: 14px; padding: 0; background: #26262c; color: #e8e8ee; width: min(440px, 100% - 24px); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); color-scheme: dark; font-size: 13px; }
.dlg.wide { width: min(640px, 100% - 24px); }
.dlg::backdrop { background: rgba(8, 8, 12, .45); }
.dlg header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; }
.dlg h2 { margin: 0; font-size: 15px; }
.dlg h3 { font-size: 12px; color: #9c9ca8; text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 6px; }
.dlg-body { padding: 8px 14px; max-height: 70vh; overflow: auto; }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px 14px; }
.dlg .ib { color: #e8e8ee; width: 28px; height: 28px; } .dlg .ib svg { width: 16px; height: 16px; }
.dlg .btn { background: #303037; border: 1px solid #3a3a43; color: #e8e8ee; min-height: 34px; padding: 6px 16px; border-radius: 8px; font-size: 13px; }
.dlg .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.dlg .field { color: #9c9ca8; } .dlg input:not([type="checkbox"]):not([type="range"]):not([type="color"]), .dlg select { background: #303037; border: 1px solid #3a3a43; border-radius: 7px; padding: 6px 9px; color: #e8e8ee; width: 100%; }
.dlg input[type="color"] { width: 48px; height: 30px; background: #303037; border: 1px solid #3a3a43; border-radius: 7px; padding: 2px; }
.dlg .chip { background: #303037; border: 1px solid #3a3a43; color: #e8e8ee; }
.dlg .muted { color: #9c9ca8; }
.dlg .check { color: #e8e8ee; }
.field.fx { grid-template-columns: 1fr 70px auto; align-items: center; column-gap: 8px; }
.field.fx span { grid-column: 1 / -1; }
.field.fx input[type="number"] { width: 70px !important; }
.field.fx i { font-style: normal; color: #9c9ca8; }
.seg.fmt { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 4px; background: #303037; padding: 4px; border-radius: 9px; margin-bottom: 12px; }
.seg.fmt button { border: 0; background: none; color: #e8e8ee; padding: 7px; border-radius: 6px; font-weight: 600; }
.seg.fmt button.on { background: var(--brand); color: #fff; }
.est { background: #303037; border-radius: 9px; padding: 9px 12px; margin: 4px 0 0; }
.est b { font-size: 15px; } .est small { color: #9c9ca8; margin-inline-start: 8px; }
.warn { color: #ffb86b; font-size: 12.5px; }
.anchor { display: grid; grid-template-columns: repeat(3, 26px); gap: 3px; }
.anchor button { width: 26px; height: 26px; border: 1px solid #3a3a43; background: #303037; border-radius: 4px; }
.anchor button.on { background: var(--brand); border-color: var(--brand); }
.curves { width: 100%; max-width: 320px; aspect-ratio: 1; height: auto; display: block; margin: 0 auto; border-radius: 6px; touch-action: none; cursor: crosshair; }
.keys { width: 100%; border-collapse: collapse; } .keys td { padding: 4px 6px; border-bottom: 1px solid #3a3a43; } .keys td:last-child { text-align: end; }
.keys kbd { font: inherit; background: #303037; border: 1px solid #45454f; border-radius: 5px; padding: 1px 6px; }

/* ---------- phones and narrow windows ---------- */
@media (max-width: 860px) {
  /* Canvas on top; the panels become one sheet under it (the canvas shrinks and refits, so the photo stays in view); tools at the bottom. */
  .ed { grid-template-rows: 44px 40px minmax(0, 1fr); }
  .ed-status { display: none; }
  .ed-menus .menu { display: none; } .ed-menus .menu-all { display: block; }
  .menu-all > .menu-pop { position: fixed; top: 44px; inset-inline-start: 6px; max-height: calc(100vh - 60px); overflow: auto; min-width: 260px; }
  .menu-all .menu-pop .menu-pop { position: static; box-shadow: none; border: 0; padding: 0 0 0 10px; background: none; }
  [dir="rtl"] .menu-all .menu-pop .menu-pop { padding: 0 10px 0 0; }
  .menu-pop .mi.sub:hover > .menu-pop { display: none; } .menu-pop .mi.sub.open > .menu-pop { display: block; }
  .ed-logo span { display: none; }
  .ed .ib { width: 36px; height: 36px; }
  .hide-sm { display: none !important; } .show-sm { display: inline-grid !important; }
  .ed-save span { display: none; } .ed-save { padding: 6px 10px; }
  .ed-body { display: flex; flex-direction: column; }
  .ed-main { order: 1; flex: 1 1 auto; min-height: 140px; }
  .ed.one-doc .ed-tabs { display: none; }
  .ed-dock { order: 2; display: none; flex: 0 1 auto; max-height: 50%; overflow: auto; border: 0; border-top: 1px solid var(--e-line); border-radius: 14px 14px 0 0; margin-top: -8px; position: relative; z-index: 2; }
  .ed.side-open .ed-dock { display: block; }
  .ed-sheet-bar { display: flex; justify-content: flex-end; position: sticky; top: 0; height: 0; z-index: 3; overflow: visible; }
  .ed-sheet-bar .ib { margin: 4px 6px 0; background: var(--e-panel-2); width: 30px; height: 30px; }
  .ed[data-sheet="props"] .panel:not(.p-props), .ed[data-sheet="layers"] .panel:not(.p-layers):not(.p-history), .ed[data-sheet="history"] .panel:not(.p-history) { display: none; }
  .ed[data-sheet="layers"] .p-history { display: none; }
  .p-props .pb, .p-history .pb { max-height: none; }
  .panel.collapsed .pb { display: block; }
  .ed-tools { order: 3; flex: 0 0 54px; flex-direction: row; justify-content: flex-start; border: 0; border-top: 1px solid #111; padding: 0 6px; overflow-x: auto; gap: 2px; }
  .tool { width: 40px; height: 40px; }
  .colors { margin: 4px 6px 0; }
  .fly { min-width: 180px; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
