:root {
  /* Emerald & Gold: deep green sidebar, gold accents, clean white page */
  --bg: #f2f5f3; --card: #fff; --ink: #13211c; --muted: #5d6d66; --line: #dce4df; --line2: #c5d0ca;
  --brand: #0f7a5a; --brand-ink: #0a5c44; --brand-soft: #e0f2ea;
  --dark: #06261e; --dark2: #0b3a2d; --dark3: #12533f; --gold: #d9b65c; --gold2: #b8892f; --cream: #f6e7b8;
  --ok: #1a8f55; --ok-soft: #e4f4ea; --warn: #a66200; --warn-soft: #fff1d6; --bad: #c8343c; --bad-soft: #fdeceb;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }

/* ---- controls ---- */
.btn { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: #fff; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f4f8f6; }
.btn.primary { background: var(--dark2); border-color: var(--dark); color: var(--cream); }
.btn.primary:hover { background: var(--dark3); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon { border: 0; background: none; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; flex: none; }
.icon:hover { background: #e6eeea; color: var(--ink); }
.icon.del:hover { background: var(--bad-soft); color: var(--bad); }
.icon:disabled { opacity: .25; cursor: default; background: none; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], select, textarea {
  border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
input.ghost { border-color: transparent; background: transparent; }
input.ghost:hover { border-color: var(--line2); background: #fff; }
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea, label.field > .row { margin-top: 5px; font-weight: 400; color: var(--ink); font-size: 15px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; user-select: none; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 38px; height: 22px; border-radius: 11px; background: #c3cdc8; position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { left: 18px; }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch .off { color: var(--bad); }
.switch .on { color: var(--ok); }

/* ---- sign in ---- */
.auth { min-height: 100vh; background: linear-gradient(160deg, var(--dark), var(--dark2) 55%, var(--dark3)); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth .card { width: 100%; max-width: 400px; padding: 30px; }
.auth h1 { font-size: 22px; margin: 14px 0 4px; }
.auth form { display: grid; gap: 14px; margin-top: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.logo b { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #ecd28a, var(--gold2)); color: var(--dark); display: grid; place-items: center; font-size: 16px; font-family: Georgia, 'Times New Roman', serif; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 9px 12px; font-size: 14px; }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; }
.side { width: 244px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 18px 12px 14px;
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark2) 55%, var(--dark3) 100%); color: #e6f0eb; }
.side .brand { padding: 2px 8px 16px; }
.side .brand .logo { color: #fff; font-size: 17px; font-family: Georgia, "Times New Roman", serif; letter-spacing: .01em; }
.side .brand small { display: block; margin: 10px 0 0; color: #b7cdc3; font-size: 13px; font-weight: 600; }
.side .badge { display: inline-block; margin-top: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dark); background: linear-gradient(135deg, #ecd28a, var(--gold2)); border-radius: 20px; padding: 3px 10px; }
.side .loc { margin: 0 4px 6px; width: calc(100% - 8px); font-weight: 600; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; }
.side .loc option { color: var(--ink); background: #fff; }
.side h4 { margin: 16px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #d0b56a; }
.side nav { display: grid; gap: 3px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 6px 8px; border-radius: 10px; text-decoration: none; color: #e6f0eb; font-weight: 600; }
.side nav a:hover { background: rgba(255,255,255,.07); }
.side nav a.on { background: var(--bg); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.ico { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.09); display: grid; place-items: center; flex: none; }
.ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side nav a.on .ico { background: linear-gradient(135deg, #ecd28a, var(--gold2)); color: var(--dark); }
.side .foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: #a9c0b6; overflow-wrap: anywhere; }
.side .foot b { display: block; color: #fff; font-size: 13.5px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 30px; background: #fff; border-bottom: 1px solid var(--line);
  border-top: 3px solid; border-image: linear-gradient(90deg, var(--gold2), #ecd28a, var(--gold2)) 1; position: sticky; top: 0; z-index: 4; }
.topbar h1 { font-size: 24px; font-family: Georgia, "Times New Roman", serif; }
.topbar .date { color: var(--muted); font-size: 13px; }
.topbar .who { color: var(--muted); font-size: 13.5px; text-align: right; }
.main { flex: 1; min-width: 0; padding: 24px 30px 50px; max-width: 1310px; width: 100%; }
.footbar { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; padding: 14px 30px; background: var(--dark); color: #b7cdc3; font-size: 13.5px; }
.footbar a { color: #e6f0eb; text-decoration: none; }
.footbar a:hover { color: var(--gold); }
.banner { border-radius: 10px; padding: 11px 15px; margin-bottom: 18px; background: var(--warn-soft); color: var(--warn); font-weight: 600; display: flex; align-items: center; gap: 12px; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner .grow { font-weight: 500; }
.head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head p { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.card + .card { margin-top: 16px; }
.plans > .card, .stats > .card, .grid > .card { margin-top: 0; }
.card > .top { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); }
.card > .pad { padding: 16px; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---- menu editor ---- */
.cat-name { font-size: 17px; font-weight: 700; }
.item-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--line); }
.item-row.out { background: #f6f9f7; }
.item-row.out .i-name { text-decoration: line-through; color: var(--muted); }
.thumb { width: 44px; height: 44px; border-radius: 8px; border: 1px dashed var(--line2); background: #f4f8f6 center/cover no-repeat; cursor: pointer; flex: none; color: var(--muted); font-size: 18px; padding: 0; }
.thumb.has { border-style: solid; }
.i-text { flex: 1; min-width: 120px; display: grid; gap: 2px; }
.i-name { font-weight: 600; }
.i-desc { font-size: 13px; color: var(--muted); padding-top: 4px !important; padding-bottom: 4px !important; }
.i-badge { width: 112px !important; flex: none; font-size: 13px; }
.price { display: flex; align-items: center; border: 1px solid var(--line2); border-radius: 8px; background: #fff; width: 118px; flex: none; }
.price:focus-within { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.price span { padding-left: 10px; color: var(--muted); font-weight: 600; }
.price input { border: 0 !important; outline: 0 !important; background: none; font-weight: 700; font-size: 16px; padding-left: 4px; }
.add-row { padding: 10px 14px; }

/* ---- slideshows ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { border: 1px solid var(--line2); background: #fff; border-radius: 20px; padding: 6px 14px; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 46%); gap: 20px; align-items: start; }
.split .right { position: sticky; top: 16px; }
.preview { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; border: 6px solid var(--dark); }
.preview iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 720px; border: 0; transform-origin: 0 0; pointer-events: none; }
.themes { display: flex; gap: 8px; flex-wrap: wrap; }
.theme { border: 2px solid transparent; border-radius: 10px; padding: 3px; cursor: pointer; background: none; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.theme.on { border-color: var(--brand); color: var(--ink); }
.theme i { display: block; width: 62px; height: 38px; border-radius: 6px; border: 1px solid var(--line2); position: relative; margin-bottom: 3px; }
.theme i::after { content: ""; position: absolute; left: 8px; right: 22px; bottom: 9px; height: 5px; border-radius: 3px; background: var(--a); }
.slide-card .top { cursor: pointer; }
.slide-card .kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--brand-soft); color: var(--brand-ink); border-radius: 5px; padding: 3px 7px; flex: none; }
.slide-card .sum { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.slide-card.disabled .sum { color: var(--muted); text-decoration: line-through; }
.slide-card .top:only-child { border-bottom: 0; }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-weight: 400; color: var(--ink); font-size: 14px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pick { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.pick .thumb { width: 72px; height: 44px; }
.secs { width: 74px !important; flex: none; }

/* ---- screens ---- */
.steps { display: grid; gap: 6px; color: var(--muted); margin-bottom: 14px; padding-left: 20px; }
.steps b { color: var(--ink); }
.code-input { font: 700 22px Consolas, Menlo, monospace !important; letter-spacing: .2em; text-transform: uppercase; width: 180px !important; text-align: center; }
.screen-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.screen-row:last-child, .item-row:last-of-type { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; width: 150px; flex: none; color: var(--muted); }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #b9c4be; }
.status.on { color: var(--ok); }
.status.on::before { background: var(--ok); }

/* ---- media ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.tile .pic { aspect-ratio: 4 / 3; background: var(--dark) center/cover no-repeat; display: grid; place-items: center; color: #fff; font-size: 26px; width: 100%; border: 0; padding: 0; }
button.pic { cursor: pointer; }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .name { padding: 6px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.tile .icon { position: absolute; top: 5px; right: 5px; background: rgba(255,255,255,.92); }
.modal { position: fixed; inset: 0; background: rgba(27,20,16,.55); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 20; }
.modal .card { width: 100%; max-width: 760px; max-height: 86vh; display: flex; flex-direction: column; }
.modal .body { padding: 16px; overflow: auto; }

/* ---- billing ---- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.plan { padding: 18px; }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan h3 { font-size: 17px; }
.plan .amount { font-size: 30px; font-weight: 800; margin: 8px 0 2px; }
.plan .amount small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan .btn { margin-top: 14px; width: 100%; justify-content: center; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 20px; padding: 2px 9px; background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 22px; font-weight: 600; opacity: 0; transition: all .2s; pointer-events: none; z-index: 30; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }

/* ---- compact layout: use the whole monitor, no wasted space ---- */
body { font-size: 14px; }
.btn { padding: 5px 11px; border-radius: 7px; }
.btn.small { padding: 3px 8px; font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], select, textarea { padding: 5px 8px; border-radius: 7px; }
label.field { font-size: 12px; }
label.field > input, label.field > select, label.field > textarea, label.field > .row { margin-top: 3px; font-size: 14px; }
.side { width: 208px; padding: 12px 8px 10px; }
.side .brand { padding: 0 6px 10px; }
.side .brand img { display: block; max-width: 100%; max-height: 46px; margin-top: 8px; border-radius: 6px; background: #fff; padding: 3px; }
.side h4 { margin: 10px 10px 4px; }
.side nav { gap: 2px; }
.side nav a { padding: 4px 6px; gap: 9px; border-radius: 8px; }
.side nav a i { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: var(--gold); color: var(--dark); border-radius: 10px; padding: 0 6px; }
.ico { width: 26px; height: 26px; border-radius: 7px; }
.ico svg { width: 15px; height: 15px; }
.col { min-height: 100vh; }
.topbar { padding: 7px 14px; gap: 8px; }
.topbar h1 { font-size: 19px; }
.topbar .date, .topbar .who { font-size: 12px; }
.main { padding: 10px 14px 14px; max-width: none; }
.footbar { position: sticky; bottom: 0; z-index: 4; padding: 7px 14px; font-size: 12.5px; }
.banner { padding: 6px 12px; margin-bottom: 8px; border-radius: 8px; }
.banner.info { background: var(--brand-soft); color: var(--brand-ink); }
.head { margin-bottom: 8px; gap: 8px; }
.card { border-radius: 9px; }
.card + .card { margin-top: 8px; }
.card > .top { padding: 5px 8px 5px 12px; gap: 6px; }
.card > .pad { padding: 10px 12px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 8px; align-items: start; }
.cats > .card { margin: 0; }
.cat-name { font-size: 15px; }
.item-row { padding: 3px 8px 3px 10px; gap: 6px; }
.thumb { width: 34px; height: 34px; border-radius: 7px; font-size: 15px; }
.i-text { gap: 0; min-width: 110px; }
.i-desc { padding-top: 1px !important; padding-bottom: 1px !important; font-size: 12px; }
.i-badge { width: 92px !important; font-size: 12px; }
.price { width: 92px; }
.price input { font-size: 14px; }
.switch { font-size: 12px; gap: 6px; }
.icon { width: 24px; height: 24px; font-size: 13px; }
.add-row { padding: 5px 10px; }
.tabs { margin-bottom: 8px; }
.tabs button { padding: 4px 12px; }
.split { gap: 10px; }
.form { gap: 9px; }
.form .two { gap: 9px; }
.pick .thumb { width: 60px; height: 36px; }
.vprev { display: block; width: 220px; max-width: 100%; border-radius: 7px; background: #000; margin-top: 6px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.tile .pic { position: relative; overflow: hidden; }
.tile .pic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .pic .play { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(0,0,0,.6); border-radius: 4px; padding: 1px 6px; }
.screen-row { padding: 6px 10px; gap: 8px; }
.steps { gap: 2px; margin-bottom: 8px; }
.plans { gap: 8px; }
.plan { padding: 12px; }
.plan .amount { font-size: 24px; margin: 4px 0 0; }
.plan .btn { margin-top: 8px; }
.empty { padding: 14px; }
.logo-pick { width: 120px; height: 60px; background-size: contain; background-color: #fff; }

/* ---- notifications + support ---- */
.bell { position: relative; }
.bell i { position: absolute; top: -5px; right: -5px; font-style: normal; font-size: 10.5px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 9px; padding: 0 5px; }
.pop { position: absolute; right: 14px; top: 48px; width: 360px; max-width: calc(100vw - 28px); max-height: 70vh; overflow: auto; z-index: 10; box-shadow: 0 12px 40px rgba(6,38,30,.25); }
.note { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note.new { background: var(--brand-soft); }
.note b { display: block; }
.note p { white-space: pre-wrap; color: var(--ink); margin-top: 2px; }
.note small { color: var(--muted); }
.desk { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 8px; align-items: start; }
.tk { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 7px 12px; cursor: pointer; }
.tk:hover, .tk.on { background: var(--brand-soft); }
.tk b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk small { color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; max-height: 52vh; overflow: auto; }
.msg { max-width: 78%; padding: 6px 10px; border-radius: 10px; background: #eef2f0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--dark2); color: #fff; }
.msg small { display: block; opacity: .65; font-size: 11px; margin-top: 2px; }
@media (max-width: 760px) { .desk { grid-template-columns: 1fr; } .cats { grid-template-columns: 1fr; } }


.bell svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
/* admin tables */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.stats > .card { margin: 0; padding: 8px 12px; border-top: 3px solid var(--gold); }
.stat b { display: block; font-size: 22px; font-family: Georgia, "Times New Roman", serif; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 5px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f6f9f7; position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t td select { width: 132px; }
.scroll { overflow-x: auto; }

/* ---- Template Builder ---- */
.modal { z-index: 60; }
#toast { z-index: 70; }
.bld { position: fixed; inset: 0; z-index: 40; background: #e9eeeb; display: flex; flex-direction: column; font-size: 13px; }
.bld-top { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--dark); color: #fff; flex-wrap: wrap; }
.bld-top .btn { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #fff; }
.bld-top .btn:hover { background: rgba(255,255,255,.18); }
.bld-top .btn.primary { background: linear-gradient(135deg, #ecd28a, var(--gold2)); border-color: var(--gold2); color: var(--dark); padding: 5px 20px; }
.bld-top .btn:disabled { opacity: .35; }
.bld-title { font-family: Georgia, "Times New Roman", serif; font-size: 15px; margin: 0 4px; color: var(--cream); }
.bld-name { width: 210px !important; background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.22) !important; color: #fff !important; font-weight: 600; }
.bld-sep { width: 1px; height: 22px; background: rgba(255,255,255,.2); margin: 0 3px; }
.bld-status { color: #b7cdc3; font-size: 12px; margin-right: 4px; }
.bld-body { flex: 1; min-height: 0; display: flex; }
.bld-left, .bld-right { background: #fff; overflow-y: auto; flex: none; }
.bld-left { width: 214px; border-right: 1px solid var(--line); }
.bld-right { width: 286px; border-left: 1px solid var(--line); }
.bld-stage { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: #dfe5e2 radial-gradient(#c9d2cd 1px, transparent 1px) 0 0 / 18px 18px; }
.bld-canvas { position: relative; flex: none; box-shadow: 0 6px 30px rgba(6,38,30,.3); user-select: none; touch-action: none; }
.bld-canvas .dz-el { cursor: move; }
.bld-sel { position: absolute; border: 0 solid #1e90ff; pointer-events: none; z-index: 5; }
.bld-sel i { position: absolute; background: #fff; border: 0 solid #1e90ff; border-radius: 50%; pointer-events: auto; }
.bld-guide { position: absolute; background: #ff3d8b; z-index: 6; pointer-events: none; }
.bld-h { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.bld-hint { color: var(--muted); font-size: 12px; padding: 4px 10px; line-height: 1.35; }
.bld-layer { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; overflow: hidden; }
.bld-layer:hover { background: #f4f8f6; }
.bld-layer.on { background: var(--brand-soft); font-weight: 600; }
.bld-layer .grow { overflow: hidden; text-overflow: ellipsis; }
.bld-layer button { border: 0; background: none; cursor: pointer; padding: 0 2px; font-size: 13px; color: var(--muted); }
.bld-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; background: #e6eeea; border-radius: 4px; padding: 1px 5px; color: var(--brand-ink); flex: none; }
.bld-g { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.bld-g > *:not(.bld-h) { margin-left: 10px; margin-right: 10px; }
.bld-g textarea { width: calc(100% - 20px); }
.bld-f { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bld-f > span { display: block; margin-bottom: 2px; }
.bld-f input, .bld-f select { font-size: 13px; padding: 3px 6px !important; }
.bld-lab { display: block; margin-top: 7px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bld-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.bld-col { display: flex; gap: 5px; align-items: center; }
.bld-col input[type=color] { width: 34px; height: 26px; padding: 1px; border: 1px solid var(--line2); border-radius: 6px; background: #fff; flex: none; }
.bld-x { border: 1px solid var(--line2); background: #fff; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; color: var(--muted); flex: none; }
.bld-none { color: var(--muted); font-weight: 400; }
.bld-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bld-checks { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; }
.bld-c { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12.5px; }
.bld-hint { margin: 0 !important; }

/* ---- template library / galleries ---- */
.tthumb { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0b0f17; overflow: hidden; border-radius: 7px 7px 0 0; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; display: flex; flex-direction: column; }
.tcard .tname { font-weight: 700; padding: 5px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .tmeta { padding: 2px 8px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tcard .tact { padding: 5px 8px 8px; display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.tcard select { font-size: 12px; padding: 2px 5px !important; width: auto; max-width: 100%; }
button.tcard { cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; }
button.tcard:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.tblank { display: grid; place-items: center; color: #b7cdc3; font-size: 34px; }
.tlib { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 8px; align-items: start; }
.tlib .tk i { float: right; font-style: normal; color: var(--muted); font-size: 12px; }
.slide-thumb { width: 250px; max-width: 100%; border-radius: 7px; }
.modal .card.wide { max-width: 1080px; }
@media (max-width: 760px) { .tlib { grid-template-columns: 1fr; } .bld-left { display: none; } .bld-right { width: 230px; } }

/* ---- builder: timeline, pickers, preview ---- */
.bld-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bld-mid .bld-stage { flex: 1; min-height: 0; }
.bld-tl { position: relative; flex: none; height: 168px; background: #fff; border-top: 1px solid var(--line); display: flex; flex-direction: column; font-size: 12px; }
.bld-rows { flex: 1; overflow-y: auto; }
.bld-row { display: flex; align-items: center; height: 24px; border-bottom: 1px solid #f1f4f6; cursor: pointer; }
.bld-row.on { background: var(--brand-soft); }
.bld-row.head { height: 30px; cursor: default; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.bld-rl { width: 150px; flex: none; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.bld-track { position: relative; flex: 1; height: 100%; margin-right: 8px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), #eef2f5 calc(12.5% - 1px), #eef2f5 12.5%); }
.bld-track.ruler { background: none; }
.bld-track.ruler u { position: absolute; top: 8px; text-decoration: none; font-size: 10.5px; color: var(--muted); transform: translateX(-50%); }
.bld-track.ruler u:first-child { transform: none; }
.bld-bar { position: absolute; top: 4px; height: 16px; border-radius: 5px; background: linear-gradient(90deg, #35b48a, #1f9d74); cursor: grab; min-width: 10px; }
.bld-bar.none { background: #e4e9ed; cursor: pointer; }
.bld-bar i { position: absolute; right: 0; top: 0; width: 7px; height: 100%; border-radius: 0 5px 5px 0; background: rgba(0,0,0,.25); cursor: ew-resize; }
.bld-head { display: none; position: absolute; top: 30px; bottom: 0; left: 158px; width: 2px; background: #ff3d8b; pointer-events: none; }
.bld-pop { position: fixed; z-index: 55; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 44px rgba(28,39,51,.18); padding: 8px; width: 322px; max-height: 60vh; overflow: auto; }
.bld-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bld-pick button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; padding: 0; background: #fff; }
.bld-pick button:hover { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.bld-pv { position: fixed; inset: 0; z-index: 58; background: #0c1116; display: flex; flex-direction: column; align-items: center; }
.bld-pvbar { align-self: stretch; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; color: #dfe7ee; flex: none; }
.bld-pvbar .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.bld-pvs { position: relative; flex: none; overflow: hidden; }
@keyframes pv-fade { from { opacity: 0; } }
@keyframes pv-left { from { transform: translateX(100%); } }
@keyframes pv-right { from { transform: translateX(-100%); } }
@keyframes pv-up { from { transform: translateY(100%); } }
@keyframes pv-zoom { from { opacity: 0; transform: scale(.82); } }
.pv-fade { animation: pv-fade .8s ease both; } .pv-left { animation: pv-left .8s ease both; } .pv-right { animation: pv-right .8s ease both; }
.pv-up { animation: pv-up .8s ease both; } .pv-zoom { animation: pv-zoom .8s ease both; }

/* ==== White theme ("kashbon": bright, soft, airy). Everything sits on white. ==== */
:root {
  --bg: #ffffff; --card: #ffffff; --ink: #1c2733; --muted: #6b7885; --line: #edf1f4; --line2: #dbe2e8;
  --brand: #1f9d74; --brand-ink: #167a5a; --brand-soft: #eaf7f2; --sky: #eef6fc; --sky-ink: #2f7fb8;
  --dark: #1c2733; --dark2: #1f9d74; --dark3: #188562; --gold: #1f9d74; --gold2: #188562; --cream: #ffffff;
  --shadow: 0 1px 2px rgba(28,39,51,.04), 0 8px 26px rgba(28,39,51,.06);
}
body { background: #fff radial-gradient(1200px 520px at 100% -10%, #f1f8fd 0, rgba(241,248,253,0) 70%) no-repeat fixed; }
.card { border-color: var(--line); box-shadow: var(--shadow); }
.btn { border-color: var(--line2); color: var(--ink); background: #fff; }
.btn:hover { background: #f7fafb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(31,157,116,.22); }
.btn.primary:hover { background: var(--dark3); }
.icon:hover { background: #f1f5f8; }
.logo b { background: linear-gradient(135deg, #46c79b, #1f9d74); color: #fff; }
.auth { background: #fff radial-gradient(900px 500px at 50% -10%, #eaf4fb 0, rgba(234,244,251,0) 70%); }
.auth .card { box-shadow: 0 2px 6px rgba(28,39,51,.04), 0 24px 70px rgba(28,39,51,.1); }
/* sidebar */
.side { background: #fff; color: var(--ink); border-right: 1px solid var(--line); }
.side .brand .logo { color: var(--ink); }
.side .brand small { color: var(--muted); }
.side .brand img { background: #fff; border: 1px solid var(--line); }
.side .badge { background: var(--sky); color: var(--sky-ink); }
.side .loc { background: #fff; border-color: var(--line2); color: var(--ink); }
.side h4 { color: #a3aeb9; }
.side nav a { color: #36424e; }
.side nav a:hover { background: #f5f8fa; }
.side nav a.on { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.side nav a i { background: var(--brand); color: #fff; }
.ico { background: #f3f6f9; color: #5d6b78; }
.side nav a.on .ico { background: var(--brand); color: #fff; }
.side .foot { border-top-color: var(--line); color: var(--muted); }
.side .foot b { color: var(--ink); }
/* top bar and footer */
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-top: 0; border-image: none; border-bottom: 1px solid var(--line); }
.footbar { background: rgba(255,255,255,.96); color: var(--muted); border-top: 1px solid var(--line); }
.footbar a { color: #36424e; }
.footbar a:hover { color: var(--brand-ink); }
/* details */
.banner { background: #fff8e9; color: #8a5a00; }
.banner.info { background: var(--sky); color: var(--sky-ink); }
.stats > .card { border-top: 0; }
.stat b { color: var(--brand-ink); }
table.t th { background: #fafcfd; }
.item-row.out { background: #fbfcfd; }
.thumb { background-color: #f7fafb; }
.preview { border: 1px solid var(--line2); box-shadow: var(--shadow); }
.tile .pic { background-color: #f1f5f8; color: #5d6b78; }
.tile .pic .play { color: #fff; }
.slide-card .kind, .bld-kind { background: var(--sky); color: var(--sky-ink); }
.tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.msg { background: #f3f6f9; }
.msg.me { background: var(--brand); color: #fff; }
.note.new, .tk:hover, .tk.on { background: var(--brand-soft); }
.pop { box-shadow: 0 14px 44px rgba(28,39,51,.16); }
.modal { background: rgba(28,39,51,.32); }
.switch i { background: #cfd8df; }
#toast { background: #1c2733; }
.tcard { border-color: var(--line); box-shadow: var(--shadow); }
/* builder on white */
.bld { background: #fff; }
.bld-top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
.bld-top .btn { border-color: var(--line2); background: #fff; color: var(--ink); }
.bld-top .btn:hover { background: #f5f8fa; }
.bld-top .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.bld-title { color: var(--brand-ink); }
.bld-name { background: #fff !important; border-color: var(--line2) !important; color: var(--ink) !important; }
.bld-sep { background: var(--line2); }
.bld-status { color: var(--muted); }
.bld-stage { background: #f6f9fb radial-gradient(#e3e9ee 1px, transparent 1px) 0 0 / 18px 18px; }
.bld-canvas { box-shadow: 0 10px 40px rgba(28,39,51,.18); }
.bld-layer:hover { background: #f7fafb; }
.bld-pvbar .btn:hover { background: rgba(255,255,255,.25); }

/* ==== Pure white: buttons, tabs, menu highlights and badges are white too ==== */
:root { --brand: #1c2733; --brand-ink: #1c2733; --brand-soft: #f5f7f9; --sky: #ffffff; --sky-ink: #4d5a67; --dark2: #1c2733; --dark3: #1c2733; --gold: #1c2733; --gold2: #1c2733; }
body, .auth { background: #ffffff; }
.btn.primary { background: #fff; color: var(--ink); border: 1.5px solid #1c2733; font-weight: 700; box-shadow: 0 1px 2px rgba(28,39,51,.06); }
.btn.primary:hover { background: #f5f7f9; }
.btn.danger { color: var(--bad); }
.logo b { background: #fff; color: var(--ink); border: 1.5px solid #1c2733; }
.side .badge { background: #fff; color: var(--sky-ink); border: 1px solid var(--line2); }
.side nav a.on { background: #f5f7f9; color: var(--ink); }
.ico { background: #fff; border: 1px solid var(--line); color: #5d6b78; }
.side nav a.on .ico { background: #fff; border-color: #1c2733; color: var(--ink); }
.side nav a i { background: #fff; color: var(--ink); border: 1px solid #1c2733; }
.tabs button.on { background: #fff; border: 1.5px solid #1c2733; color: var(--ink); }
.banner { background: #fff; border: 1px solid var(--line2); color: var(--ink); }
.banner.info { background: #fff; color: var(--ink); }
.banner.bad { background: #fff; border-color: #f0c9cb; color: var(--bad); }
.stat b { color: var(--ink); }
.slide-card .kind, .bld-kind { background: #fff; color: var(--sky-ink); border: 1px solid var(--line2); }
.msg.me { background: #fff; color: var(--ink); border: 1px solid #1c2733; }
.note.new { background: #fff; box-shadow: inset 3px 0 0 #1c2733; }
.tk:hover, .tk.on { background: #f5f7f9; }
.pill, .pill.warn, .pill.bad { background: #fff; border: 1px solid currentColor; }
.switch input:checked + i { background: #1c2733; }
.switch .on { color: var(--ink); }
.status.on { color: var(--ink); }
.status.on::before { background: #2fb37f; }
a { color: var(--ink); }
.bld-top .btn.primary { background: #fff; color: var(--ink); border: 1.5px solid #1c2733; }
.bld-title { color: var(--ink); }
.bld-bar { background: #5d6b78; }
.bld-bar i { background: rgba(255,255,255,.55); }
.bld-row.on, .bld-layer.on { background: #f5f7f9; }
.bld-pick button:hover { border-color: #1c2733; box-shadow: none; }
.bld-stage { background: #fbfcfd radial-gradient(#e6ebef 1px, transparent 1px) 0 0 / 18px 18px; }
button.tcard:hover { border-color: #1c2733; box-shadow: var(--shadow); }
/* timeline rows */
.bld-rt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bld-row.head .bld-rl { overflow: visible; }
.bld-base { position: absolute; left: 0; right: 0; top: 8px; height: 8px; border-radius: 4px; background: #eef1f4; }
.bld-track { background: none; }

/* ---- Home: live screens ---- */
.home { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 8px; align-items: start; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.card.live { position: relative; margin: 0; overflow: hidden; }
.live-thumb { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0b0f17; overflow: hidden; }
.live-thumb iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; border: 0; transform-origin: 0 0; pointer-events: none; }
.live-thumb.none { display: grid; place-items: center; background: #f5f7f9; color: var(--muted); font-size: 13px; }
.card.live.off .live-thumb { filter: grayscale(1) brightness(.75); }
.live-tag { position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; padding: 2px 8px; border-radius: 20px; background: rgba(28,39,51,.78); color: #fff; }
.live-tag.on { background: #d92d3a; }
.live-info { padding: 8px 10px 10px; display: grid; gap: 2px; }
.stat.bad b { color: var(--bad); }
.issue { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.issue:last-child { border-bottom: 0; }
.issue i { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #c9d1d9; }
.issue.bad i { background: var(--bad); } .issue.warn i { background: #e0a030; } .issue.ok i { background: #2fb37f; }
/* ---- Store settings ---- */
.sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 8px; align-items: start; }
.sgrid > .card { margin: 0; }
.logo-prev { height: 120px; border: 1px solid var(--line2); border-radius: 9px; display: grid; place-items: center; overflow: hidden; background: #fff; }
.logo-prev.dark { background: #0b0f17; color: #fff; font-family: Georgia, "Times New Roman", serif; font-weight: 700; }
.logo-prev img { max-width: 90%; object-fit: contain; }
input[type=range] { width: 100%; accent-color: #1c2733; }
.topbar .who { display: flex; align-items: center; gap: 8px; text-align: left; }
.topbar .who img { height: 30px; max-width: 90px; object-fit: contain; }
.topbar .who b { color: var(--ink); }
/* ---- Plans: four cards ---- */
.plans4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 8px; align-items: stretch; }
.plan4 { position: relative; margin: 0 !important; padding: 20px 18px 18px; display: flex; flex-direction: column; min-height: 420px; border-radius: 14px; }
.plan4.current { border: 1.5px solid #1c2733; }
.plan4 h3 { font-size: 19px; font-family: Georgia, "Times New Roman", serif; }
.plan4 .amount { font-size: 40px; font-weight: 800; margin: 14px 0 12px; letter-spacing: -.02em; }
.plan4 .amount small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan4 ul { list-style: none; margin: 0 0 16px; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.plan4 li { position: relative; padding-left: 22px; }
.plan4 li::before { content: "\2713"; position: absolute; left: 0; font-weight: 700; }
.plan4 .btn { margin-top: auto; justify-content: center; padding: 9px 12px; }
.plan-tag { position: absolute; top: 12px; right: 12px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border: 1px solid #1c2733; border-radius: 20px; padding: 2px 9px; background: #fff; }
@media (max-width: 1100px) { .plans4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .plans4 { grid-template-columns: 1fr; } }
/* Store settings: cards stack in columns so there are no holes between them */
.sgrid { display: block; columns: 3 340px; column-gap: 8px; }
.sgrid > .card { break-inside: avoid; margin: 0 0 8px; }

/* ---- Store cameras ---- */
.camview { cursor: zoom-in; display: grid; place-items: center; }
.camview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-none { color: #b8c1cc; font-size: 13px; }
.card.live.cam.big { grid-column: 1 / -1; }
.card.live.cam.big .camview { cursor: zoom-out; }
.act-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px 8px; }
.act-now b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.act-now span { font-size: 12.5px; }
.issue.up i { background: #2fb37f; } .issue.down i { background: #e0a030; }
.act-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 12px 12px 4px; }
.act-bars > div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.act-bars i { display: block; width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; background: #c9d1d9; }
.act-bars .now i { background: #1c2733; }
.act-bars span { font-size: 10.5px; color: var(--muted); }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: #1c2733; }
.choice input { margin-top: 4px; accent-color: #1c2733; }


/* ==== Red theme (YouTube red): buttons, menu and highlights ==== */
:root { --red: #ff0000; --red-dark: #cc0000; --red-soft: #fff0f0; --red-line: #ffb8b8; --brand: #ff0000; --brand-ink: #cc0000; --brand-soft: #fff0f0; }
a { color: var(--red-dark); }
.btn { border-color: var(--red-line); color: var(--red-dark); background: #fff; }
.btn:hover { background: var(--red-soft); border-color: var(--red); }
.btn.primary, .bld-top .btn.primary { background: var(--red); border: 1.5px solid var(--red); color: #fff; font-weight: 700; box-shadow: 0 1px 2px rgba(204,0,0,.25); }
.btn.primary:hover, .bld-top .btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.danger { color: var(--bad); border-color: #f0c9cb; }
.logo b { background: var(--red); color: #fff; border-color: var(--red); }
.side { border-right: 1px solid var(--line); }
.side h4 { color: var(--red-dark); }
.side .badge { background: var(--red-soft); color: var(--red-dark); border-color: var(--red-line); }
.ico { color: var(--red-dark); border-color: #ffdada; }
.side nav a:hover { background: var(--red-soft); }
.side nav a.on { background: var(--red); color: #fff; }
.side nav a.on .ico { background: #fff; border-color: #fff; color: var(--red); }
.side nav a i { background: var(--red); color: #fff; border-color: var(--red); }
.side nav a.on i { background: #fff; color: var(--red-dark); }
.side .foot b { color: var(--red-dark); }
.topbar { border-bottom: 2px solid var(--red); }
.stats > .card { border-top: 3px solid var(--red); }
.tabs button.on { background: var(--red); border-color: var(--red); color: #fff; }
.switch input:checked + i { background: var(--red); }
input:focus, select:focus, textarea:focus { border-color: var(--red); outline: 2px solid rgba(255,0,0,.14); outline-offset: 0; }
input[type=range], .choice input, input[type=checkbox], input[type=radio] { accent-color: var(--red); }
.plan4.current, .choice:has(input:checked) { border-color: var(--red); }
.plan-tag { background: var(--red); border-color: var(--red); color: #fff; }
.plan4 li::before { color: var(--red); }
.act-bars .now i { background: var(--red); }
.msg.me { border-color: var(--red); }
.note.new { box-shadow: inset 3px 0 0 var(--red); }
.footbar a:hover { color: var(--red-dark); }
.card > .top > b:first-child, .card > .top > h3:first-child { position: relative; padding-left: 10px; }
.card > .top > b:first-child::before, .card > .top > h3:first-child::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; border-radius: 2px; background: var(--red); }

/* ---- Top bar: phone, support site, social links ---- */
.topinfo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-right: 4px; }
.tinfo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.tinfo:hover { color: var(--red-dark); }
.tinfo i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.tinfo.add { color: var(--muted); font-weight: 500; }
.social { display: flex; gap: 5px; }
.soc { width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; text-decoration: none; }
.soc:hover { background: var(--red-dark); }
.menu-btn { display: none; font-size: 18px; line-height: 1; padding: 5px 10px; }
.nav-back { display: none; }

/* ---- Home: big main screen on the left; attention, slideshows and camera view on the right ---- */
.home { grid-template-columns: minmax(0, 3fr) minmax(350px, 1fr); gap: 8px; align-items: stretch; }
.mainscreen { margin: 0; min-height: calc(100vh - 262px); min-height: calc(100dvh - 262px); }
.mainscreen .live-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.mainscreen .live-grid.one { grid-template-columns: minmax(0, 880px); justify-content: center; }
.mainscreen .live-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rightcol { display: grid; gap: 8px; align-content: start; min-width: 0; }
.rightcol > .card { margin: 0; }
.cambox .live-grid { grid-template-columns: 1fr; }
.card.live.cam.big { position: fixed; inset: 4vh 4vw; z-index: 55; display: flex; flex-direction: column; box-shadow: 0 0 0 100vmax rgba(28,39,51,.55); }
.card.live.cam.big .camview { flex: 1; aspect-ratio: auto; }

/* ---- Slides: drag to reorder; several slideshows per screen ---- */
.grip { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; padding: 2px 6px; margin-left: -4px; color: #a3aeb9; font-size: 18px; line-height: 1; border-radius: 6px; }
.grip:hover { color: var(--red); background: var(--red-soft); }
.slide-card.dragging { opacity: .45; }
.drop-line { height: 4px; border-radius: 2px; background: var(--red); margin: 3px 0; }
.pickb { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

/* ==== Tablets and phones ==== */
.shell, .col { min-height: 100dvh; }
@media (pointer: coarse) { .btn { min-height: 36px; } .btn.small { min-height: 32px; } .side nav a { padding: 8px; } .grip { padding: 8px 10px; } }
@media (max-width: 1500px) { .tinfo.add { display: none; } }
@media (max-width: 1280px) {
  .home { grid-template-columns: 1fr; }
  .mainscreen { min-height: 0; }
  .rightcol { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}
@media (max-width: 1024px) {
  .menu-btn { display: inline-flex; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: 264px; z-index: 70; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); padding-top: max(12px, env(safe-area-inset-top)); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .nav-back { display: block; position: fixed; inset: 0; background: rgba(28,39,51,.4); z-index: 65; }
  .topbar { flex-wrap: wrap; position: sticky; top: 0; z-index: 10; padding-top: max(7px, env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .topinfo { order: 9; width: 100%; gap: 12px; }
  .topbar .who { display: none; }
  .main { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .footbar { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .desk { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; } /* stops iPhone zooming in on a field */
  .main { padding-top: 8px; }
  .topbar .date, .topbar > a.btn { display: none; }
  .topbar h1 { font-size: 17px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-grid, .mainscreen .live-grid, .mainscreen .live-grid.two { grid-template-columns: minmax(0, 1fr); }
  .rightcol, .sgrid { grid-template-columns: minmax(0, 1fr); columns: 1; }
  .two { grid-template-columns: 1fr; }
  .status { width: auto; }
  .screen-row { gap: 6px; }
  .slide-card .top { flex-wrap: wrap; }
  .modal { padding: 8px; }
  .modal .card { max-height: 92dvh; }
  .footbar { position: static; }
  .act-now b { font-size: 18px; }
  .head { align-items: flex-start; }
  .pickb { max-width: 100%; }
}
.pill { white-space: nowrap; }
.cats { grid-template-columns: repeat(auto-fill, minmax(min(500px, 100%), 1fr)); }
@media (max-width: 1024px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split .right { position: static; }
}
@media (max-width: 640px) {
  .item-row { flex-wrap: wrap; }
  .item-row .i-text { flex: 1 1 100%; min-width: 0; }
  .mainscreen > .top .muted { display: none; }
  .card > .top { flex-wrap: wrap; }
  .themes { gap: 6px; }
}
@media (max-width: 640px) { .slide-card .top .sum { flex: 1 1 100%; order: 9; } }

/* ==== Header and footer: one clean line each, on every screen ==== */
.topbar { flex-wrap: nowrap; }
.topbar > .grow { min-width: 0; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .btn, .topbar .date { white-space: nowrap; flex: none; }
.topinfo { flex-wrap: nowrap; flex: none; }
.footbar { border-top: 2px solid var(--red); flex-wrap: nowrap; gap: 16px; }
.footbar .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.footbar nav { display: flex; gap: 18px; flex: none; }
.footbar nav a { font-weight: 600; white-space: nowrap; }
.side-info { display: none; }
@media (max-width: 1280px) { .topbar .topinfo .tinfo:not(.add) { font-size: 12.5px; } .topinfo { gap: 10px; } }
@media (max-width: 1024px) {
  /* The header keeps only the page name and its buttons; phone, support and social links move into the menu */
  .topbar { flex-wrap: nowrap; }
  .topbar .topinfo { display: none; }
  .side-info { display: block; margin-top: auto; padding: 12px 8px; border-top: 1px solid var(--line); }
  .side-info .topinfo { display: grid; gap: 10px; width: auto; justify-items: start; }
  .side-info .tinfo.add { display: inline-flex; }
  .side-info + .foot { margin-top: 0; }
  .scroll table th, .scroll table td { white-space: nowrap; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .footbar { position: static; flex-direction: column; align-items: center; gap: 6px; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); text-align: center; }
  .footbar nav { order: 1; gap: 22px; }
  .footbar .grow { order: 2; flex: none; font-size: 12px; }
  .rights { display: none; }
  .card { border: 1px solid var(--line2); }
}
@media (max-width: 1024px) { .scroll table td .row { flex-wrap: nowrap !important; } }
.live-thumb iframe { transition: opacity .35s ease; }
.live-thumb[hidden] { display: none; }
.choice.tick { padding: 6px 12px; align-items: center; gap: 8px; }
.choice.tick input { margin: 0; }

/* ---- Design editor: player under the canvas (replaces the timeline) ---- */
.bld-tl.bld-play { height: auto; padding: 12px 16px 14px; align-items: center; gap: 8px; background: #fafbfc; }
.pl-row { display: flex; align-items: center; justify-content: center; gap: 26px; width: 100%; }
.pl-btn { width: 44px; height: 44px; padding: 7px; border: 0; background: none; color: var(--red); cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.pl-btn:hover { background: var(--red-soft); }
.pl-btn.on { background: var(--red); color: #fff; }
.pl-btn.big { width: 64px; height: 64px; padding: 15px; background: var(--red); color: #fff; box-shadow: 0 3px 10px rgba(204,0,0,.35); }
.pl-btn.big:hover { background: var(--red-dark); }
.pl-bar { -webkit-appearance: none; appearance: none; width: min(420px, 70%); height: 18px; background: none; border: 0; padding: 0; outline: 0 !important; cursor: pointer; --at: 0%; }
.pl-bar::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--red) var(--at), #f3b5b5 var(--at)); }
.pl-bar::-moz-range-track { height: 3px; border-radius: 2px; background: #f3b5b5; }
.pl-bar::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--red); }
.pl-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px; border-radius: 50%; background: var(--red); border: 0; }
.pl-bar::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 0; }
.pl-time { font-size: 12px; color: var(--muted); min-width: 86px; font-variant-numeric: tabular-nums; }
.pl-row + .pl-row { gap: 12px; }
