/* OverlayV — stylesheet.
 *
 * Everything is driven by the tokens in :root. The light theme re-declares
 * the same names and nothing else, which is why a control never needs a
 * second rule to work in both.
 *
 * A note on type size: the panels are deliberately larger than a typical web
 * app's. An editor is read at a glance while your attention is on the canvas,
 * and small grey 12px labels are the first thing to fail at that.
 *
 * A note on gradients: no text anywhere is painted with a gradient through
 * background-clip. It renders as a solid filled box in several Android
 * webviews, and a headline that turns into a coloured rectangle on a third of
 * phones is not worth the effect. Gradients are used on shapes only.
 */

/* ==== tokens ============================================================= */

:root {
  --ov-bg: #09090B;
  --ov-panel: #111116;
  --ov-elev: #18181F;
  --ov-elev-2: #20202A;
  --ov-line: rgba(255, 255, 255, 0.08);
  --ov-line-2: rgba(255, 255, 255, 0.14);
  --ov-text: #F4F4F6;
  --ov-muted: #A1A1AA;
  --ov-faint: #71717A;

  --ov-primary: #7C3AED;
  --ov-primary-soft: #A78BFA;
  --ov-secondary: #FF5C7A;
  --ov-accent: #38BDF8;
  --ov-danger: #F0505E;
  --ov-ok: #34D399;

  --ov-grad: linear-gradient(135deg, #7C3AED, #FF5C7A);
  --ov-radius: 14px;
  --ov-radius-sm: 10px;
  --ov-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 24px 60px rgba(0, 0, 0, .5);
  --ov-focus: 0 0 0 3px rgba(124, 58, 237, .45);

  --ov-top-h: 62px;
  --ov-left-w: 300px;
  --ov-right-w: 320px;

  /* The checkerboard behind a transparent canvas. Editor-only: it is a CSS
     background on the board, so it can never reach an exported PNG. */
  --ov-check-a: #1B1B22;
  --ov-check-b: #23232C;
}

:root[data-theme="light"] {
  --ov-bg: #F7F7FA;
  --ov-panel: #FFFFFF;
  --ov-elev: #FFFFFF;
  --ov-elev-2: #F1F1F5;
  --ov-line: rgba(9, 9, 11, 0.09);
  --ov-line-2: rgba(9, 9, 11, 0.16);
  --ov-text: #17171C;
  --ov-muted: #62626E;
  --ov-faint: #8B8B96;
  --ov-shadow: 0 1px 2px rgba(9, 9, 11, .08), 0 18px 44px rgba(9, 9, 11, .12);
  --ov-check-a: #E6E6EC;
  --ov-check-b: #F2F2F6;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ov-bg: #F7F7FA;
    --ov-panel: #FFFFFF;
    --ov-elev: #FFFFFF;
    --ov-elev-2: #F1F1F5;
    --ov-line: rgba(9, 9, 11, 0.09);
    --ov-line-2: rgba(9, 9, 11, 0.16);
    --ov-text: #17171C;
    --ov-muted: #62626E;
    --ov-faint: #8B8B96;
    --ov-shadow: 0 1px 2px rgba(9, 9, 11, .08), 0 18px 44px rgba(9, 9, 11, .12);
    --ov-check-a: #E6E6EC;
    --ov-check-b: #F2F2F6;
  }
}

/* ==== base =============================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ov-bg);
  color: var(--ov-text);
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.ov-booting .ov-app { opacity: 0; }
.ov-app { opacity: 1; transition: opacity .25s ease; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ov-focus); border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==== app shell ========================================================== */

.ov-app {
  height: 100dvh;
  min-height: 560px;
  display: grid;
  grid-template-rows: var(--ov-top-h) 1fr;
  overflow: hidden;
}

.ov-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--ov-panel);
  border-bottom: 1px solid var(--ov-line);
  min-width: 0;
}

.ov-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex: none;
}
.ov-brand img { border-radius: 9px; display: block; }
.ov-brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.ov-brand-name b { color: var(--ov-primary-soft); font-weight: 800; }

.ov-namewrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ov-name {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  max-width: 320px;
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
.ov-name:hover { border-color: var(--ov-line); }
.ov-name:focus { border-color: var(--ov-primary); background: var(--ov-elev); outline: none; box-shadow: none; }

.ov-savedbadge {
  font-size: 13px;
  color: var(--ov-ok);
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
  white-space: nowrap;
  flex: none;
}
.ov-savedbadge.show { opacity: 1; }

.ov-top-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.ov-sep { width: 1px; height: 24px; background: var(--ov-line); margin: 0 3px; }

.ov-main {
  display: grid;
  grid-template-columns: var(--ov-left-w) 1fr var(--ov-right-w);
  min-height: 0;
  overflow: hidden;
}

/* ==== panels ============================================================= */

.ov-left, .ov-right {
  background: var(--ov-panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.ov-left { border-right: 1px solid var(--ov-line); }
.ov-right { border-left: 1px solid var(--ov-line); }

.ov-left.collapsed { display: none; }

.ov-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--ov-line);
  flex: none;
}

.ov-panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ov-left-foot { padding: 10px 12px; border-top: 1px solid var(--ov-line); flex: none; }

.ov-right-tabs { display: flex; border-bottom: 1px solid var(--ov-line); flex: none; }
.ov-right-tab {
  flex: 1;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 8px 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ov-muted);
}
.ov-right-tab.on { color: var(--ov-text); border-bottom-color: var(--ov-primary); }

/* ==== canvas area ======================================================== */

.ov-center {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(124, 58, 237, .10), transparent 70%),
    var(--ov-bg);
}

.ov-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 28px;
  scrollbar-width: thin;
}

.ov-board {
  position: relative;
  flex: none;
  box-shadow: 0 0 0 1px var(--ov-line-2), 0 30px 70px rgba(0, 0, 0, .45);
  border-radius: 2px;
}
.ov-board.checker {
  background-color: var(--ov-check-a);
  background-image:
    linear-gradient(45deg, var(--ov-check-b) 25%, transparent 25%, transparent 75%, var(--ov-check-b) 75%),
    linear-gradient(45deg, var(--ov-check-b) 25%, transparent 25%, transparent 75%, var(--ov-check-b) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}
.ov-board canvas { position: absolute; inset: 0; display: block; }
#ov-overlay { touch-action: none; }

.ov-welcome {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  pointer-events: none;
  z-index: 3;
}
.ov-welcome > * { pointer-events: auto; }
.ov-welcome h2 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.ov-welcome p { margin: 0; max-width: 440px; color: var(--ov-muted); font-size: 16px; }

.ov-welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 560px;
  width: 100%;
  margin-top: 6px;
}
.ov-welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  background: var(--ov-elev);
  border: 1px solid var(--ov-line);
  border-radius: var(--ov-radius);
  color: var(--ov-text);
  font-size: 14.5px;
  font-weight: 600;
  transition: transform .16s, border-color .16s, background .16s;
}
.ov-welcome-card:hover { transform: translateY(-2px); border-color: var(--ov-primary); background: var(--ov-elev-2); }
.ov-welcome-card .wi { color: var(--ov-primary-soft); display: grid; place-items: center; }

.ov-zoombar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  background: var(--ov-elev);
  border: 1px solid var(--ov-line);
  border-radius: 999px;
  box-shadow: var(--ov-shadow);
  z-index: 4;
}
.ov-zoomlabel {
  background: none;
  border: 0;
  padding: 6px 12px;
  font-size: 14.5px;
  font-weight: 700;
  min-width: 62px;
  border-radius: 999px;
}
.ov-zoomlabel:hover { background: var(--ov-elev-2); }

.ov-privacy {
  position: absolute;
  right: 14px;
  bottom: 18px;
  margin: 0;
  font-size: 12.5px;
  color: var(--ov-faint);
  pointer-events: none;
  z-index: 4;
}

/* ==== buttons ============================================================ */

.ov-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid var(--ov-line-2);
  background: var(--ov-elev);
  color: var(--ov-text);
  font-size: 15px;
  font-weight: 700;
  transition: background .15s, border-color .15s, transform .15s, opacity .15s;
  white-space: nowrap;
}
.ov-btn:hover { background: var(--ov-elev-2); }
.ov-btn:active { transform: translateY(1px); }
.ov-btn:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.ov-btn.primary { background: var(--ov-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(124, 58, 237, .32); }
.ov-btn.primary:hover { filter: brightness(1.07); }
.ov-btn.ghost { background: transparent; }
.ov-btn.ghost:hover { background: var(--ov-elev-2); }
.ov-btn.danger { background: var(--ov-danger); border-color: transparent; color: #fff; }
.ov-btn.full { width: 100%; }
.ov-btn.sm { padding: 8px 14px; font-size: 14px; }
.ov-btn.smart { background: var(--ov-elev-2); border-color: var(--ov-line-2); }
.ov-btn.smart .sp { font-size: 15px; }
.ov-exportbtn { margin-left: 4px; padding: 11px 22px; }

.ov-ico {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ov-text);
  transition: background .15s, opacity .15s;
  flex: none;
}
.ov-ico:hover { background: var(--ov-elev-2); }
.ov-ico:disabled { opacity: .3; cursor: not-allowed; }
.ov-ico.tiny { width: 30px; height: 30px; border-radius: 8px; color: var(--ov-muted); }
.ov-ico.tiny:hover { color: var(--ov-text); }
.ov-ico.danger:hover { color: var(--ov-danger); }
#ov-zoom-out, #ov-zoom-in { font-size: 19px; font-weight: 700; line-height: 1; }

/* ==== template browser =================================================== */

.ov-tpl-searchwrap { position: relative; padding: 12px 12px 8px; }
.ov-tpl-searchico {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-25%);
  color: var(--ov-faint);
  pointer-events: none;
  display: grid;
}
.ov-tpl-search {
  width: 100%;
  padding: 11px 12px 11px 40px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  font-size: 15px;
}
.ov-tpl-search:focus { border-color: var(--ov-primary); outline: none; box-shadow: none; }
.ov-tpl-search::-webkit-search-cancel-button { filter: invert(.5); }

.ov-tpl-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 12px 12px;
  scrollbar-width: none;
}
.ov-tpl-chips::-webkit-scrollbar { display: none; }
.ov-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  font-size: 14px;
  font-weight: 600;
  color: var(--ov-muted);
  white-space: nowrap;
}
.ov-chip:hover { color: var(--ov-text); }
.ov-chip.on { background: var(--ov-primary); border-color: transparent; color: #fff; }
.ov-chip svg { flex: none; }

.ov-tpl-body { padding: 0 12px 20px; }

.ov-tpl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 2px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ov-faint);
}
.ov-tpl-head .th-ico { display: grid; color: var(--ov-primary-soft); }
.ov-tpl-head .th-n {
  margin-left: auto;
  letter-spacing: 0;
  background: var(--ov-elev-2);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
}

.ov-tpl-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ov-tpl-cell { position: relative; }

.ov-tpl-card {
  display: block;
  width: 100%;
  padding: 0 0 9px;
  background: var(--ov-elev);
  border: 1px solid var(--ov-line);
  border-radius: var(--ov-radius);
  overflow: hidden;
  text-align: left;
  transition: border-color .16s, transform .16s;
}
.ov-tpl-card:hover { border-color: var(--ov-primary); transform: translateY(-2px); }

.ov-tpl-thumb {
  height: 116px;
  display: grid;
  place-items: center;
  background-color: var(--ov-check-a);
  background-image:
    linear-gradient(45deg, var(--ov-check-b) 25%, transparent 25%, transparent 75%, var(--ov-check-b) 75%),
    linear-gradient(45deg, var(--ov-check-b) 25%, transparent 25%, transparent 75%, var(--ov-check-b) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}
.ov-tpl-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ov-tpl-thumb.loading { animation: ovpulse 1.3s ease-in-out infinite; }
@keyframes ovpulse { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }

.ov-tpl-name {
  display: block;
  padding: 9px 12px 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ov-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-tpl-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 0;
  background: rgba(9, 9, 11, .55);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, .7);
  opacity: 0;
  transition: opacity .15s, color .15s;
}
.ov-tpl-cell:hover .ov-tpl-fav, .ov-tpl-fav.on, .ov-tpl-fav:focus-visible { opacity: 1; }
.ov-tpl-fav.on { color: #F5B833; }

.ov-catnote {
  display: flex;
  gap: 9px;
  margin: 2px 2px 12px;
  padding: 11px 13px;
  border-radius: var(--ov-radius-sm);
  background: rgba(56, 189, 248, .10);
  border: 1px solid rgba(56, 189, 248, .3);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ov-text);
}
.ov-catnote .ci { color: var(--ov-accent); flex: none; display: grid; padding-top: 1px; }

/* ==== inspector ========================================================== */

.ov-inspector, .ov-layerspanel { padding-bottom: 30px; }
.ov-inspector-body { padding: 0; }

.ov-insp-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 15px 16px 12px;
  font-size: 16px;
  font-weight: 800;
  border-bottom: 1px solid var(--ov-line);
}
.ov-insp-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--ov-faint);
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}

.ov-sec { border-bottom: 1px solid var(--ov-line); }
.ov-sec-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: none;
  border: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ov-muted);
}
.ov-sec-head:hover { color: var(--ov-text); }
.ov-sec-chev { display: grid; transition: transform .2s; }
.ov-sec.open .ov-sec-chev { transform: rotate(180deg); }
.ov-sec-body { display: none; padding: 2px 16px 18px; }
.ov-sec.open .ov-sec-body { display: block; }

.ov-field { margin-bottom: 15px; }
.ov-field:last-child { margin-bottom: 0; }
.ov-field.inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ov-field.inline .ov-label { margin-bottom: 0; }
.ov-field.muted .ov-readonly { color: var(--ov-faint); font-size: 14.5px; font-weight: 600; }

.ov-field-head { display: flex; align-items: baseline; justify-content: space-between; }
.ov-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ov-muted);
  margin-bottom: 7px;
}
.ov-unit { font-size: 12.5px; color: var(--ov-faint); flex: none; min-width: 14px; }
.ov-hint { font-size: 12.5px; color: var(--ov-faint); margin-top: 2px; max-width: 190px; line-height: 1.4; }
.ov-mini { font-size: 12.5px; color: var(--ov-faint); flex: none; width: 54px; }
.ov-gap { height: 12px; }

.ov-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.ov-row2 > .ov-field { margin-bottom: 0; }

.ov-input, .ov-select, .ov-num {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  font-size: 15px;
  font-weight: 500;
}
.ov-input:focus, .ov-select:focus, .ov-num:focus,
.ov-hex:focus { border-color: var(--ov-primary); outline: none; box-shadow: none; }
textarea.ov-input { resize: vertical; min-height: 74px; line-height: 1.45; }
.ov-select { appearance: none; padding-right: 32px; background-image: none; }
.ov-num { width: 74px; text-align: center; padding: 9px 6px; }
.ov-num.wide { width: 100%; }
.ov-num::-webkit-outer-spin-button, .ov-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ov-num { -moz-appearance: textfield; }

.ov-slider-row { display: flex; align-items: center; gap: 9px; }

.ov-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--ov-elev-2);
  border: 1px solid var(--ov-line);
}
.ov-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ov-primary);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.ov-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ov-primary);
  border: 2px solid #fff;
  cursor: pointer;
}

/* colour field */
.ov-color-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ov-color-controls { display: flex; align-items: center; gap: 8px; }
.ov-swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--ov-line-2);
  flex: none;
  padding: 0;
}
.ov-swatch.none {
  background-color: var(--ov-elev-2) !important;
  background-image: linear-gradient(45deg, transparent 44%, var(--ov-danger) 44%, var(--ov-danger) 56%, transparent 56%);
}
.ov-color-native { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.ov-hex {
  width: 96px;
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
}
.ov-alpha-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ov-swatches { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.ov-chipcolor {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--ov-line-2);
  padding: 0;
}
.ov-chipcolor.none {
  background-color: var(--ov-elev-2);
  background-image: linear-gradient(45deg, transparent 44%, var(--ov-danger) 44%, var(--ov-danger) 56%, transparent 56%);
}

/* segmented */
.ov-seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--ov-elev-2);
  border: 1px solid var(--ov-line);
  border-radius: var(--ov-radius-sm);
}
.ov-seg.grow { display: flex; width: 100%; }
.ov-seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ov-muted);
  white-space: nowrap;
}
.ov-seg-btn:hover { color: var(--ov-text); }
.ov-seg-btn.on { background: var(--ov-panel); color: var(--ov-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.ov-seg-btn.it span { font-style: italic; font-family: Georgia, serif; }
.ov-seg-btn.un span { text-decoration: underline; }
.ov-seg-btn.st span { text-decoration: line-through; }

/* toggle */
.ov-toggle {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--ov-line-2);
  background: var(--ov-elev-2);
  padding: 2px;
  flex: none;
  transition: background .18s;
  position: relative;
}
.ov-toggle .knob {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ov-muted);
  transition: transform .18s, background .18s;
}
.ov-toggle.on { background: var(--ov-primary); border-color: transparent; }
.ov-toggle.on .knob { transform: translateX(20px); background: #fff; }

/* align grid */
.ov-alignrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ov-align {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  color: var(--ov-muted);
}
.ov-align:hover { color: var(--ov-text); border-color: var(--ov-primary); }

/* style presets */
.ov-stylepresets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.ov-stylepreset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 4px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ov-muted);
}
.ov-stylepreset:hover { border-color: var(--ov-primary); color: var(--ov-text); }
.ov-stylepreset .sw {
  width: 100%;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--ov-line-2);
}

/* presets (canvas sizes) */
.ov-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ov-preset {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 11px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  text-align: left;
}
.ov-preset:hover { border-color: var(--ov-primary); }
.ov-preset.on { border-color: var(--ov-primary); background: rgba(124, 58, 237, .14); }
.ov-preset .pn { font-size: 14px; font-weight: 700; }
.ov-preset .pd { font-size: 12px; color: var(--ov-faint); }

/* icon picker */
.ov-iconpick-group {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ov-faint);
  margin: 12px 0 7px;
}
.ov-iconpick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ov-iconpick-btn {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  color: var(--ov-muted);
}
.ov-iconpick-btn:hover { color: var(--ov-text); border-color: var(--ov-primary); }
.ov-iconpick-btn.on { background: var(--ov-primary); border-color: transparent; color: #fff; }

.ov-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ov-faint);
  margin: 12px 16px 0;
  display: flex;
  gap: 8px;
}
.ov-sec-body .ov-note { margin: 12px 0 0; }
.ov-note .ci { flex: none; display: grid; padding-top: 2px; color: var(--ov-accent); }

/* Smart Text */
.ov-suggest { display: flex; flex-direction: column; gap: 7px; max-height: 260px; overflow-y: auto; }
.ov-suggestion {
  text-align: left;
  padding: 11px 13px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid var(--ov-line);
  background: var(--ov-elev);
  font-size: 15px;
  font-weight: 600;
}
.ov-suggestion:hover { border-color: var(--ov-primary); background: var(--ov-elev-2); }

/* ==== layers ============================================================= */

.ov-layers { padding: 8px; }
.ov-layer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--ov-radius-sm);
  border: 1px solid transparent;
  font-size: 14.5px;
  cursor: pointer;
  user-select: none;
}
.ov-layer:hover { background: var(--ov-elev); }
.ov-layer.on { background: rgba(124, 58, 237, .16); border-color: var(--ov-primary); }
.ov-layer.hidden .ov-layer-name { opacity: .45; text-decoration: line-through; }
.ov-layer.dragging { opacity: .4; }
.ov-layer.drop-before { box-shadow: 0 -2px 0 var(--ov-secondary); }
.ov-layer.drop-after { box-shadow: 0 2px 0 var(--ov-secondary); }
.ov-layer-ico { color: var(--ov-faint); display: grid; flex: none; }
.ov-layer.on .ov-layer-ico { color: var(--ov-primary-soft); }
.ov-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ov-layer-grp {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ov-faint);
  background: var(--ov-elev-2);
  border-radius: 5px;
  padding: 1px 5px;
  flex: none;
}
.ov-layer-acts { display: flex; gap: 1px; flex: none; opacity: .5; }
.ov-layer:hover .ov-layer-acts, .ov-layer.on .ov-layer-acts { opacity: 1; }
.ov-layer-rename {
  flex: 1;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 7px;
  border: 1px solid var(--ov-primary);
  background: var(--ov-panel);
  font-size: 14px;
}

/* ==== toasts, dialogs, menus ============================================= */

.ov-toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}
.ov-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ov-elev);
  border: 1px solid var(--ov-line-2);
  box-shadow: var(--ov-shadow);
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s, transform .2s;
  pointer-events: auto;
  cursor: pointer;
  max-width: min(92vw, 460px);
}
.ov-toast.in { opacity: 1; transform: none; }
.ov-toast svg { flex: none; color: var(--ov-ok); }
.ov-toast.error svg { color: var(--ov-danger); }
.ov-toast.warn svg { color: #F5B833; }

.ov-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, .62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 260;
  opacity: 0;
  transition: opacity .18s;
}
.ov-backdrop.in { opacity: 1; }
.ov-dialog {
  width: 100%;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--ov-panel);
  border: 1px solid var(--ov-line-2);
  border-radius: 20px;
  box-shadow: var(--ov-shadow);
  padding: 22px;
  transform: translateY(8px) scale(.99);
  transition: transform .18s;
}
.ov-backdrop.in .ov-dialog { transform: none; }
.ov-dialog-title { margin: 0 0 12px; font-size: 21px; font-weight: 800; letter-spacing: -.015em; }
.ov-dialog-body { font-size: 15.5px; color: var(--ov-muted); line-height: 1.6; }
.ov-dialog-body p { margin: 0 0 12px; }
.ov-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; flex-wrap: wrap; }

.ov-menu {
  position: fixed;
  min-width: 210px;
  background: var(--ov-elev);
  border: 1px solid var(--ov-line-2);
  border-radius: var(--ov-radius);
  box-shadow: var(--ov-shadow);
  padding: 6px;
  z-index: 280;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .14s, transform .14s;
}
.ov-menu.in { opacity: 1; transform: none; }
.ov-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
}
.ov-menu-item:hover:not(:disabled) { background: var(--ov-elev-2); }
.ov-menu-item:disabled { opacity: .38; cursor: not-allowed; }
.ov-menu-item.danger { color: var(--ov-danger); }
.ov-menu-item .mi { display: grid; color: var(--ov-muted); flex: none; width: 18px; }
.ov-menu-item.danger .mi { color: var(--ov-danger); }
.ov-menu-item .ml { flex: 1; }
.ov-menu-item .mh { font-size: 12px; color: var(--ov-faint); font-weight: 600; }
.ov-menu-sep { height: 1px; background: var(--ov-line); margin: 5px 6px; }

/* ==== empty states ======================================================= */

.ov-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  padding: 40px 22px;
  color: var(--ov-muted);
}
.ov-empty-ico {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--ov-elev);
  border: 1px solid var(--ov-line);
  color: var(--ov-faint);
}
.ov-empty-title { font-size: 16px; font-weight: 700; color: var(--ov-text); }
.ov-empty-msg { margin: 0; font-size: 14px; max-width: 250px; line-height: 1.5; }

/* ==== export & help ====================================================== */

.ov-export .ov-seg { margin-bottom: 12px; }
.ov-exp-size { margin: 0 0 6px; font-size: 14.5px; font-weight: 700; color: var(--ov-text); }
.ov-exp-warn {
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: var(--ov-radius-sm);
  background: rgba(240, 80, 94, .12);
  border: 1px solid rgba(240, 80, 94, .35);
  color: var(--ov-text);
  font-size: 13.5px;
  line-height: 1.5;
}
.ov-exp-bg { margin-top: 14px; }

.ov-help h3 { margin: 20px 0 10px; font-size: 16px; font-weight: 800; color: var(--ov-text); }
.ov-help h3:first-child { margin-top: 0; }
.ov-help-steps { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.75; color: var(--ov-muted); }
.ov-help-steps li { margin-bottom: 3px; }
.ov-help-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.ov-help-key { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ov-muted); }
.ov-help-key kbd {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--ov-elev-2);
  border: 1px solid var(--ov-line-2);
  border-radius: 7px;
  padding: 3px 8px;
  white-space: nowrap;
  color: var(--ov-text);
  flex: none;
  min-width: 118px;
  text-align: center;
}
.ov-onboard p { margin-top: 0; }

/* ==== projects =========================================================== */

.ov-projects .ov-note { margin: 0 0 14px; }
.ov-proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.ov-proj-card {
  position: relative;
  border: 1px solid var(--ov-line);
  border-radius: var(--ov-radius);
  background: var(--ov-elev);
  overflow: hidden;
}
.ov-proj-card.current { border-color: var(--ov-primary); }
.ov-proj-open { display: block; width: 100%; padding: 0; background: none; border: 0; text-align: left; }
.ov-proj-thumb { height: 116px; display: grid; place-items: center; color: var(--ov-faint); }
.ov-proj-thumb.checker {
  background-color: var(--ov-check-a);
  background-image:
    linear-gradient(45deg, var(--ov-check-b) 25%, transparent 25%, transparent 75%, var(--ov-check-b) 75%),
    linear-gradient(45deg, var(--ov-check-b) 25%, transparent 25%, transparent 75%, var(--ov-check-b) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
}
.ov-proj-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ov-proj-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.ov-proj-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-proj-date { font-size: 12.5px; color: var(--ov-faint); }
.ov-proj-acts {
  position: absolute;
  top: 7px;
  right: 7px;
  display: flex;
  gap: 2px;
  background: rgba(9, 9, 11, .6);
  backdrop-filter: blur(6px);
  border-radius: 9px;
  padding: 2px;
  opacity: 0;
  transition: opacity .15s;
}
.ov-proj-card:hover .ov-proj-acts, .ov-proj-acts:focus-within { opacity: 1; }
.ov-storage { margin: 16px 0 0; font-size: 13px; color: var(--ov-faint); }

/* ==== mobile ============================================================= */

.ov-mobilebar { display: none; }
.ov-sheet { display: none; }

@media (max-width: 1000px) {
  :root { --ov-top-h: 56px; }

  .ov-app { grid-template-rows: var(--ov-top-h) 1fr auto; }
  .ov-main { grid-template-columns: 1fr; }
  .ov-left, .ov-right { display: none; }
  .ov-brand-name { display: none; }
  .ov-hide-sm { display: none; }
  .ov-name { max-width: none; text-align: left; }
  .ov-exportbtn { padding: 10px 16px; }
  .ov-stage { padding: 16px; }
  .ov-privacy { display: none; }
  .ov-zoombar { bottom: 12px; }
  .ov-welcome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-welcome h2 { font-size: 23px; }

  /* Lift toasts clear of the tab bar and the zoom pill. At the desktop
     position they land squarely on both. */
  .ov-toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }

  .ov-mobilebar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--ov-panel);
    border-top: 1px solid var(--ov-line);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 60;
  }
  .ov-mtab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 2px 8px;
    background: none;
    border: 0;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ov-muted);
  }
  .ov-mtab.on { color: var(--ov-primary-soft); }

  .ov-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 68dvh;
    background: var(--ov-panel);
    border-top: 1px solid var(--ov-line-2);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .5);
    transform: translateY(102%);
    transition: transform .24s cubic-bezier(.22, .8, .3, 1);
    z-index: 80;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .ov-sheet.open { transform: none; }
  .ov-sheet-grab {
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    border: 0;
    background: var(--ov-line-2);
    margin: 9px auto 4px;
    padding: 0;
  }
  .ov-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px 10px;
    font-size: 16px;
    font-weight: 800;
    border-bottom: 1px solid var(--ov-line);
    flex: none;
  }
  .ov-sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .ov-sheet-body .ov-tpl-grid { grid-template-columns: 1fr 1fr; }

  .ov-help-keys { grid-template-columns: 1fr; }
  .ov-stylepresets { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 420px) {
  .ov-top { padding: 0 9px; gap: 6px; }
  .ov-ico { width: 36px; height: 36px; }
  .ov-exportbtn { padding: 9px 13px; font-size: 14.5px; }
  .ov-namewrap { display: none; }
  .ov-top-acts { margin-left: auto; }
  .ov-savedbadge { display: none; }
  .ov-welcome-grid { grid-template-columns: 1fr 1fr; }
  .ov-dialog { padding: 18px; border-radius: 18px; }
  .ov-dialog-actions .ov-btn { flex: 1; }
}

/* ==== page content below the editor ====================================== */

.ov-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 22px 40px;
}
.ov-sec-page { margin-bottom: 46px; }
.ov-page h1 {
  font-size: clamp(28px, 4.6vw, 40px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.18;
  margin: 0 0 18px;
}
.ov-page h2 {
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}
.ov-page h3 { font-size: 17px; font-weight: 700; margin: 0 0 7px; }
.ov-page p { font-size: 17px; line-height: 1.72; color: var(--ov-muted); margin: 0 0 15px; }
.ov-page p b, .ov-page li b { color: var(--ov-text); font-weight: 700; }
.ov-lede { font-size: 18.5px !important; color: var(--ov-text) !important; }

.ov-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.ov-cards article {
  padding: 20px;
  background: var(--ov-panel);
  border: 1px solid var(--ov-line);
  border-radius: var(--ov-radius);
}
.ov-cards p { font-size: 15.5px; margin: 0; }

.ov-steps { margin: 0; padding-left: 22px; }
.ov-steps li { font-size: 17px; line-height: 1.7; color: var(--ov-muted); margin-bottom: 12px; }

.ov-faq details {
  border: 1px solid var(--ov-line);
  border-radius: var(--ov-radius);
  background: var(--ov-panel);
  padding: 15px 18px;
  margin-bottom: 10px;
}
.ov-faq summary { font-size: 16.5px; font-weight: 700; cursor: pointer; }
.ov-faq p { margin: 10px 0 0; font-size: 16px; }

.ov-disclaimer {
  padding: 22px;
  border-radius: var(--ov-radius);
  border: 1px solid var(--ov-line-2);
  background: var(--ov-panel);
}
.ov-disclaimer h2 { font-size: 19px; }
.ov-disclaimer p { margin: 0; font-size: 15.5px; }

.ov-foot {
  border-top: 1px solid var(--ov-line);
  padding-top: 26px;
  text-align: center;
}
.ov-foot p { font-size: 15px; margin: 0 0 6px; }
.ov-foot-brand { color: var(--ov-text) !important; font-size: 17px !important; }
.ov-foot-links { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin-top: 16px; }
.ov-foot-links a { color: var(--ov-primary-soft); text-decoration: none; font-size: 15px; font-weight: 600; }
.ov-foot-links a:hover { text-decoration: underline; }
