:root {
  --bg: #0a0e15;
  --side: #0c111a;
  --surface: #121826;
  --surface-2: #0d121d;
  --stage: #0e1320;
  --border: rgba(255, 255, 255, .08);
  --border-2: rgba(255, 255, 255, .16);
  --text: #e8edf6;
  --muted: #8a93a6;
  --faint: #5c6576;
  --blue: #3b82f6;
  --blue-d: #2f6be0;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #e24b4a;
  --rad: 10px;
  --rad-lg: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.muted { color: var(--muted); }
.sub-h { font-size: 14px; font-weight: 400; color: var(--muted); }

/* ---- layout ---- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex: none; background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 14px; position: sticky; top: 0; height: 100vh; }
.view { flex: 1; min-width: 0; padding: 26px 30px; overflow: auto; height: 100vh; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; margin-bottom: 22px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; background: #141b29; border: 1px solid var(--border-2); display: flex; align-items: center; justify-content: center; color: #cbd5e6; font-size: 17px; flex: none; }
.brand-name { font-size: 13px; font-weight: 500; letter-spacing: .06em; color: #fff; }
.brand-sub { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }

/* ---- nav ---- */
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.navlink { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--rad); color: var(--muted); text-decoration: none; font-size: 14px; cursor: pointer; }
.navlink i { font-size: 19px; }
.navlink:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.navlink.active { background: #1d2942; color: #fff; }
.navlink.disabled { opacity: .45; pointer-events: none; }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.side-org { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.side-org .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.side-foot .link { align-self: flex-start; }

/* ---- buttons ---- */
button { font-family: inherit; cursor: pointer; border: 0; border-radius: var(--rad); background: var(--blue); color: #fff; font-size: 14px; font-weight: 500; padding: 9px 16px; display: inline-flex; align-items: center; gap: 7px; }
button:hover { background: var(--blue-d); }
button:disabled { opacity: .6; cursor: default; }
button i { font-size: 16px; }
.secondary { background: var(--surface); border: 1px solid var(--border); color: #cfd6e4; font-weight: 400; }
.secondary:hover { background: var(--surface); border-color: var(--border-2); }
.tool { background: var(--surface); border: 1px solid var(--border); color: #cfd6e4; font-weight: 400; padding: 8px 12px; font-size: 13px; }
.tool:hover { background: var(--surface); border-color: var(--border-2); }
.danger { background: transparent; border: 1px solid rgba(226, 75, 74, .5); color: var(--red); }
.danger:hover { background: rgba(226, 75, 74, .08); }
.link { background: none; border: 0; color: var(--blue); padding: 0; font-weight: 500; font-size: 13px; }
.link:hover { background: none; color: var(--blue-d); text-decoration: underline; }
.divider { width: 1px; height: 24px; background: var(--border-2); margin: 0 2px; }

/* ---- inputs ---- */
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--rad); padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
input[type=color] { padding: 3px; height: 38px; }

/* ---- page head ---- */
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 16px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 500; }
.actions { display: flex; align-items: center; gap: 10px; }
.actions button { width: auto; }
.status { margin: 0 0 14px; font-size: 13px; }
.empty { color: var(--muted); padding: 48px; text-align: center; border: 1px dashed var(--border); border-radius: var(--rad-lg); }

/* ---- cards / grids ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad-lg); padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.wide-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card.asset { position: relative; padding: 0; overflow: hidden; }
.card.asset:hover { border-color: var(--border-2); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: #0d0f14; display: grid; place-items: center; overflow: hidden; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; bottom: 8px; left: 8px; font-size: 10px; padding: 3px 8px; border-radius: 99px; background: rgba(0, 0, 0, .6); color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.meta { padding: 11px 13px; }
.name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12px; margin-top: 2px; }
.del { width: 28px; height: 28px; padding: 0; border-radius: 8px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 18px; line-height: 1; display: none; position: absolute; top: 8px; right: 8px; justify-content: center; }
.card.asset:hover .del { display: flex; }
.del:hover { background: rgba(226, 75, 74, .85); }

/* ---- assets (pages) ---- */
.thumb-canvas { border-radius: 0; border: 0; border-bottom: 1px solid var(--border); }
.card.asset .card-link { position: absolute; inset: 0; z-index: 1; }
.card.asset .meta { position: relative; z-index: 2; pointer-events: none; }
.card.asset .del { z-index: 3; }

/* ---- playlists list ---- */
.list { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.card.row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.row-main { display: flex; flex-direction: column; gap: 3px; }
.row-title { color: var(--text); font-weight: 500; text-decoration: none; }
.row-title:hover { color: var(--blue); }
.card.row .del { position: static; display: flex; background: transparent; color: var(--muted); }
.card.row .del:hover { color: var(--red); background: transparent; }

/* ---- asset editor ---- */
.view.editing { padding: 0; overflow: hidden; }
.editor { height: 100vh; display: flex; flex-direction: column; }
.ed-top { display: flex; align-items: center; gap: 9px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.ed-top .back { color: var(--muted); font-size: 18px; text-decoration: none; padding: 4px 6px; display: inline-flex; }
.ed-top .back:hover { color: var(--text); }
.ed-top .title-input { width: auto; min-width: 160px; font-weight: 500; }
.ed-top .spacer { flex: 1; }
.ed-top button { width: auto; }
.iconbtn { background: transparent; border: 1px solid var(--border); color: var(--muted); width: 36px; height: 36px; padding: 0; justify-content: center; }
.iconbtn:hover:not(:disabled) { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.ed-tools { display: flex; align-items: center; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.ed-tools .tool { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 7px 11px; flex: none; }
.ed-tools .tool:hover { background: var(--surface); color: var(--text); }
.ed-tools .tool.ghost { color: var(--faint); cursor: default; }
.ed-tools .tool.ghost:hover { background: transparent; color: var(--faint); }
.ed-tools .divider { height: 20px; }
#save { background: var(--green); color: #06270f; }
#save:hover { background: #1eb454; }
#save.hot { box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.ed-body { flex: 1; display: flex; min-height: 0; position: relative; }
.canvas-wrap { flex: 1; min-width: 0; background: var(--stage); position: relative; overflow: auto; display: flex; align-items: safe center; justify-content: safe center; padding: 28px; }
#canvas-host { flex: none; width: 760px; }
.zoombar { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 4px; z-index: 10; }
.zoombar button { background: transparent; border: 0; color: var(--text); width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 7px; }
.zoombar button:hover { background: rgba(255, 255, 255, .07); }
.zoombar .pct { font-size: 12px; color: var(--muted); min-width: 42px; text-align: center; }
.editor-picker { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 540px; max-width: calc(100% - 280px); max-height: calc(100% - 28px); overflow: auto; z-index: 30; margin: 0; }
.canvas { position: relative; width: 100%; aspect-ratio: 16 / 9; container-type: size; overflow: hidden; background: #111418; border-radius: 8px; border: 1px solid var(--border); }
.canvas .bg-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.pitem { position: absolute; box-sizing: border-box; }
.pitem.text { overflow: hidden; line-height: 1.15; word-break: break-word; padding: 2px; }
.pitem.text .ptext { width: 100%; height: 100%; }
.pitem.image img { width: 100%; height: 100%; display: block; }
.canvas.editing .pitem { cursor: move; outline: 1px dashed transparent; }
.canvas.editing .pitem:hover { outline-color: rgba(255, 255, 255, .3); }
.canvas.editing .pitem.sel { outline: 1.5px solid var(--blue); }
.rhandle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: var(--blue); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; z-index: 9999; }
.pitem:not(.sel) .rhandle { display: none; }
.panel { width: 236px; flex: none; border-left: 1px solid var(--border); padding: 16px; background: var(--side); }
.panel .hint { font-size: 13px; color: var(--muted); }
.panel-h { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.panel label { display: block; margin: 12px 0 0; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.panel input, .panel select, .panel textarea { margin-top: 6px; }
.panel .panel-wide { width: 100%; margin-top: 10px; }
.panel-actions { display: flex; gap: 8px; margin-top: 14px; }
.panel-actions button { width: auto; flex: 1; padding: 8px; justify-content: center; }
.thumb.sm { width: 64px; height: 40px; border-radius: 6px; overflow: hidden; background: #0d0f14; flex: none; }
.thumb.sm img, .thumb.sm video { width: 100%; height: 100%; object-fit: cover; }
.thumb.sm.pv { width: 100%; height: 96px; margin-bottom: 6px; }

/* ---- playlist editor ---- */
.title-wrap { display: flex; align-items: center; gap: 14px; }
.back { color: var(--blue); text-decoration: none; font-size: 14px; white-space: nowrap; }
.title-input { width: auto; min-width: 200px; font-size: 18px; font-weight: 500; }
.items { display: flex; flex-direction: column; gap: 8px; max-width: 780px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad); padding: 8px 12px; }
.item.dragging { opacity: .4; }
.item.over { border-color: var(--blue); }
.item-left { display: flex; align-items: center; gap: 10px; }
.handle { cursor: grab; color: var(--muted); user-select: none; font-size: 13px; }
.pl-thumb { width: 96px; height: 54px; aspect-ratio: auto; flex: none; border-radius: 6px; }
.iname { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.dur { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; margin: 0; }
.dur input { width: 64px; margin: 0; padding: 6px 8px; text-align: right; }
.item .del { position: static; display: flex; background: transparent; color: var(--muted); }
.item .del:hover { color: var(--red); background: transparent; }

/* ---- picker ---- */
.picker { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--rad-lg); padding: 14px; background: var(--surface); }
.picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 340px; overflow: auto; }
.pick { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--rad); color: var(--text); width: auto; font-weight: 400; text-align: left; cursor: pointer; }
.pick:hover { border-color: var(--blue); }
.pick span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 6px; }
.pad-sm { padding: 8px; }

/* ---- login ---- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center .card { width: 100%; max-width: 400px; padding: 30px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.center h1 { margin: 0 0 6px; font-size: 21px; font-weight: 500; }
.center label { display: block; margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.center input { margin-top: 6px; }
.center button { width: 100%; margin-top: 22px; padding: 11px; justify-content: center; }
.error { color: var(--red); margin-top: 14px; font-size: 13px; }

/* ---- editor left rail + tool panels ---- */
.ed-rail { width: 74px; flex: none; background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 8px 6px; gap: 4px; }
.railbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 400; }
.railbtn i { font-size: 20px; }
.railbtn:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.railbtn.on { background: #1d2942; color: #fff; }
.ed-left { width: 252px; flex: none; background: var(--surface-2); border-right: 1px solid var(--border); padding: 16px; overflow: auto; }
.left-head { font-size: 15px; font-weight: 500; margin-bottom: 12px; }
.left-label { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 0 0 6px; }
.left-add { width: 100%; justify-content: flex-start; background: var(--surface); border: 1px solid var(--border); color: var(--text); margin-bottom: 8px; padding: 12px 14px; }
.left-add:hover { border-color: var(--border-2); background: var(--surface); }
.left-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.left-thumb { padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #0d0f14; aspect-ratio: 1; }
.left-thumb img, .left-thumb video { width: 100%; height: 100%; object-fit: cover; }
.left-thumb:hover { border-color: var(--blue); }
.shape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shape-btn { aspect-ratio: 1; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 0; justify-content: center; }
.shape-btn i { font-size: 26px; }
.shape-btn:hover { border-color: var(--blue); background: var(--surface); }
.pitem.shape svg { width: 100%; height: 100%; display: block; }
.pitem.shape .shp-line { position: absolute; left: 0; top: 50%; width: 100%; height: 0.8cqh; transform: translateY(-50%); }

/* ---- brand kit ---- */
.brand-sec { margin-bottom: 30px; }
.brand-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.sec-title { margin: 0; font-size: 16px; font-weight: 500; }
.up-btn { width: auto; }
.thumb.contain { background: #0d0f14; }
.thumb.contain img, .thumb.contain video { object-fit: contain; padding: 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 72px; height: 72px; border-radius: var(--rad); border: 1px solid var(--border-2); display: flex; align-items: flex-end; padding: 6px; }
.swatch .sw-hex { font-size: 10px; background: rgba(0,0,0,.55); color: #fff; padding: 1px 5px; border-radius: 5px; }
.swatch .sw-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0; border-radius: 6px; background: rgba(0,0,0,.5); color: #fff; font-size: 14px; line-height: 1; justify-content: center; display: none; }
.swatch:hover .sw-del { display: flex; }
.swatch.add { background: var(--surface); border-style: dashed; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.swatch.add:hover { border-color: var(--blue); color: var(--text); }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-sw { width: 28px; height: 28px; padding: 0; border-radius: 7px; border: 1px solid var(--border-2); }

/* ---- playlist row actions / preview ---- */
.row-actions { display: flex; align-items: center; gap: 4px; }
.card.row .play { position: static; background: transparent; border: 0; color: var(--muted); width: 32px; height: 32px; padding: 0; display: flex; justify-content: center; }
.card.row .play:hover { color: var(--blue); background: transparent; }

/* ---- screens ---- */
.pair-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad); padding: 14px 16px; margin-bottom: 16px; }
.pair-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pair-row input, .pair-row select { padding: 9px 11px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); }
.pair-row #pf-code { width: 140px; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.pair-steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.pair-steps li { position: relative; padding-left: 34px; line-height: 1.5; counter-increment: step; }
.pair-steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.pair-step-t { font-weight: 600; color: var(--text); }
.pair-url { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; }
.pair-url code { background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 11px; color: var(--text); font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.sdot.on { background: var(--green); box-shadow: 0 0 7px rgba(34, 197, 94, .7); }
.sdot.off { background: #4b5563; }
.row-actions select.assign { max-width: 200px; padding: 7px 9px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); }
.row-actions .rename, .row-actions .open { background: transparent; border: 0; color: var(--muted); width: 32px; height: 32px; padding: 0; display: flex; justify-content: center; align-items: center; }
.row-actions .rename:hover, .row-actions .open:hover { color: var(--blue); }
.row-actions .open:disabled { opacity: .35; cursor: default; }
.row-actions .sched.active { color: var(--green); }

/* schedule editor */
.screen-wrap { margin-bottom: 10px; }
.sched-panel { background: var(--surface-2); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--rad) var(--rad); margin-top: -8px; padding: 14px 16px 16px; }
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tz-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tz-label select, .rule input[type=time], .rule .r-pl { padding: 7px 9px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); }
.sched-hint { font-size: 12px; }
.rules { display: flex; flex-direction: column; gap: 8px; }
.rule { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.rule .days { display: flex; gap: 3px; }
.rule .day { width: 26px; height: 26px; padding: 0; border-radius: 6px; background: transparent; border: 1px solid var(--border-2); color: var(--muted); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.rule .day.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.rule .dash { color: var(--muted); }
.rule .r-pl { max-width: 180px; }
.rule .r-del { margin-left: auto; background: transparent; border: 0; color: var(--muted); width: 28px; height: 28px; padding: 0; font-size: 16px; }
.rule .r-del:hover { color: #ef4444; }
.sched-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sched-actions .spacer { flex: 1; }

/* ---- object animations (shared: editor preview + player + screen) ---- */
@keyframes anim-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes anim-fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes anim-slideInLeft { from { opacity: 0; transform: translateX(-100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes anim-slideInRight { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes anim-slideInDown { from { opacity: 0; transform: translateY(-100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes anim-slideInUp { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }
@keyframes anim-slideOutLeft { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-100%); } }
@keyframes anim-slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }
@keyframes anim-slideOutUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-100%); } }
@keyframes anim-slideOutDown { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(100%); } }
@keyframes anim-zoomIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes anim-zoomOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.6); } }
.panel-sec { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.panel-sec-h { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }

/* ---- widgets (shared render: editor + player + screen) ---- */
.w-weather { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; text-align: center; }
.w-weather .wx-now { display: flex; align-items: center; gap: .12em; }
.w-weather .wx-now .wx-ico { font-size: .9em; }
.w-weather .wx-temp { font-weight: 700; }
.w-weather .wx-cond { font-size: .3em; opacity: .9; margin-top: .12em; }
.w-weather .wx-place { font-size: .22em; opacity: .6; margin-top: .16em; text-transform: uppercase; letter-spacing: .08em; }
.w-weather .wx-place:empty { display: none; }
.w-weather .wx-meta { font-size: .2em; opacity: .85; margin-top: .55em; }
.w-weather .wx-days { display: flex; gap: .5em; margin-top: .6em; font-size: .2em; max-width: 100%; }
.w-weather .wx-day { display: flex; flex-direction: column; align-items: center; gap: .18em; }
.w-weather .wx-day .wx-dname { opacity: .7; text-transform: uppercase; letter-spacing: .03em; }
.w-weather .wx-day .wx-ico { font-size: 1.5em; }
.w-weather .wx-hl { font-weight: 600; white-space: nowrap; }
.w-weather .wx-hl small { opacity: .55; margin-left: .25em; font-weight: 400; }
.pitem.scrolltext { display: flex; align-items: center; }
.w-marquee { display: inline-flex; white-space: nowrap; will-change: transform; animation: marquee-x 20s linear infinite; }
.w-marquee > span { padding-right: 2em; }
.w-marquee .marq-sep { padding: 0 1.7em; font-style: normal; opacity: .45; vertical-align: middle; }

/* ---- sections (layout guides) ---- */
.pitem.section { border-radius: 4px; }
.pitem.section .sec-label { display: none; }
.canvas.editing .pitem.section { outline: 1px dashed rgba(255, 255, 255, .3); outline-offset: -1px; }
.canvas.editing .pitem.section.sel { outline: 1.5px solid var(--blue); }
.canvas.editing .pitem.section .sec-label { display: inline-block; position: absolute; top: 5px; left: 7px; font-size: 11px; line-height: 1; padding: 3px 6px; background: rgba(0, 0, 0, .45); color: rgba(255, 255, 255, .75); border-radius: 4px; pointer-events: none; }
.tmpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tmpl-btn { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.tmpl-btn:hover { border-color: var(--blue); }
.tmpl-prev { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--bg); border-radius: 4px; overflow: hidden; }
.tmpl-cell { position: absolute; border: 1px solid var(--border-2); background: rgba(255, 255, 255, .05); }
.tmpl-btn > span { font-size: 11px; color: var(--muted); }

/* ---- multi-select floating toolbar ---- */
.sel-toolbar { position: absolute; z-index: 50; transform: translateX(-50%); display: flex; gap: 3px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.sel-toolbar button { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: var(--text); padding: 7px 11px; border-radius: 7px; font-size: 13px; cursor: pointer; line-height: 1; }
.sel-toolbar button:hover { background: var(--surface-2); }
.sel-toolbar button i { font-size: 16px; }

/* ---- drag-and-drop upload onto the canvas ---- */
.canvas-wrap.drop-active { outline: 2px dashed var(--blue); outline-offset: -10px; background: rgba(59, 130, 246, .06); }
.canvas-wrap.drop-active::after { content: 'Drop to add to the page'; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--blue); color: #fff; font-size: 12px; padding: 5px 12px; border-radius: 999px; pointer-events: none; z-index: 60; }

/* ---- image slideshow (rotating images in one item) ---- */
.w-slideshow { overflow: hidden; }
.w-slideshow .slide-img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.w-slideshow .slide-img.active { opacity: 1; }
.w-slideshow[data-style="fade"] .slide-img { transition: opacity .8s ease; }
.w-slideshow[data-style="slide"] .slide-img { transition: opacity .8s ease, transform .8s ease; transform: translateX(10%); }
.w-slideshow[data-style="slide"] .slide-img.active { transform: translateX(0); }
.w-slideshow[data-style="none"] .slide-img { transition: none; }
.slide-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.slide-thumb { position: relative; width: 48px; height: 48px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slide-thumb .slide-rm { position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; padding: 0; border-radius: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 1; border: 0; display: flex; align-items: center; justify-content: center; }
.slide-thumb .slide-1st { position: absolute; bottom: 1px; left: 1px; font-size: 8px; background: rgba(0, 0, 0, .6); color: #fff; padding: 1px 3px; border-radius: 3px; }
.left-thumb.added { outline: 2px solid var(--green); outline-offset: -2px; }

/* ---- right-click context menu ---- */
.ctx-menu { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; padding: 4px; box-shadow: 0 10px 28px rgba(0, 0, 0, .5); min-width: 168px; display: flex; flex-direction: column; }
.ctx-menu button { justify-content: flex-start; gap: 10px; background: transparent; border: 0; color: var(--text); padding: 8px 10px; border-radius: 6px; font-size: 13px; width: 100%; font-weight: 400; }
.ctx-menu button:hover { background: var(--surface-2); }
.ctx-menu button i { font-size: 16px; color: var(--muted); }
.ctx-menu button.ctx-del { color: var(--red); }
.ctx-menu button.ctx-del:hover { background: rgba(226, 75, 74, .1); }
.ctx-menu button.ctx-del i { color: var(--red); }
@keyframes marquee-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.w-vscroll { will-change: transform; animation: vscroll linear infinite; }
.w-vscroll > div { padding: .4cqh 0; }
@keyframes vscroll { from { transform: translateY(100%); } to { transform: translateY(-110%); } }
.w-cal { width: 100%; height: 100%; display: flex; flex-direction: column; font-size: 4.2cqh; }
.w-cal .cal-h { font-weight: 700; text-align: center; margin-bottom: .8cqh; font-size: 5cqh; }
.w-cal .cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 1px; }
.w-cal .cal-grid > div { display: flex; align-items: center; justify-content: center; }
.w-cal .cal-dow { opacity: .5; }
.w-cal .cal-d.today { background: var(--blue); color: #fff; border-radius: 50%; }
/* widget picker tiles + weather location search (editor) */
.widget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.widget-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 11px; cursor: pointer; text-align: center; }
.widget-btn:hover { border-color: var(--blue); }
.widget-btn i { font-size: 22px; color: var(--blue); }
.loc-res { display: flex; flex-direction: column; gap: 3px; margin: -2px 0 10px; }
.loc-opt { text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; color: var(--text); font-size: 12px; cursor: pointer; }
.loc-opt:hover { border-color: var(--blue); }
.panel .chkrow { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.panel .chkrow input { width: auto; }
.panel .bg-row span { display: flex; align-items: center; gap: 10px; }

/* ---- new design modal ---- */
.modal-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(3, 6, 12, .62); display: grid; place-items: center; }
.modal-card { width: 340px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border-2); border-radius: 14px; padding: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.modal-x { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); width: 30px; height: 30px; border-radius: 8px; padding: 0; }
.modal-x:hover { color: var(--text); }
.md-label { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.orient-row { display: flex; gap: 10px; margin-bottom: 18px; }
.orient { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer; font-size: 13px; }
.orient.on { border-color: var(--green); color: var(--green); background: rgba(34, 197, 94, .08); }
.orient i { font-size: 18px; }
.size-row { display: flex; gap: 10px; margin-bottom: 20px; }
.size-row label { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.size-row input { padding: 9px 11px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); }
.md-create { width: 100%; background: var(--green); color: #06240f; font-weight: 600; padding: 12px; border: 0; border-radius: 10px; cursor: pointer; }
.md-create:hover { filter: brightness(1.05); }

/* per-screen welcome-message config (Screens tab) */
.welcome-panel { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.welcome-panel .wl-en-row { display: flex; align-items: center; gap: 8px; }
.welcome-panel .wl-en { width: auto; }
.welcome-panel .wl-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; }
.welcome-panel .wl-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
