/* Kino Portfolio Template v1.0 · © 2026 Matibox (Neo Lapse Creative Corporation)
   Use of this file is governed by the license you purchased. Do not redistribute or resell. */
/* Control panel styles */
:root {
  --bg: #0e0e10; --panel: #17171a; --panel-2: #1f1f23; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
  --fg: #EDEAE3; --muted: #9a968f; --accent: #FF5B2E; --on-accent: #0B0B0C;
  --ok: #8fcf8a; --warn: #e9a65a; --err: #ee8f7a; --info: #7fb6d6;
  --r: 12px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
img, video { display: block; max-width: 100%; }
code { font: 13px ui-monospace, Menlo, Consolas, monospace; background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 6px 0 0; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ico { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 14px var(--font); color: var(--fg); background: rgba(255,255,255,.1); text-decoration: none; white-space: nowrap; transition: background .2s, color .2s, opacity .2s; }
.btn:hover { background: rgba(255,255,255,.18); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(255,255,255,.08); color: var(--fg); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger:hover { color: var(--err); background: rgba(238,143,122,.12); }
.btn:disabled { opacity: .6; cursor: progress; }
.link { color: var(--accent); cursor: pointer; text-decoration: underline; }

/* forms */
label, .lbl { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label small { font-weight: 400; }
input, textarea, select { font: 15px var(--font); color: var(--fg); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,91,46,.18); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 8px; }
.stack { display: grid; gap: 16px; }
.stack.tight { gap: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.tight { gap: 4px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.row.four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.row.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 900px) { .row.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .row.two, .row.three, .row.four { grid-template-columns: 1fr; } }

.alert { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; background: var(--panel); border-left: 3px solid var(--info); }
.alert.ok { border-color: var(--ok); }
.alert.warn { border-color: var(--warn); }
.alert.err { border-color: var(--err); color: #ffd9cf; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.08); color: var(--muted); white-space: nowrap; }
.pill.draft { background: rgba(233,166,90,.14); color: var(--warn); }
.pill.ok { background: rgba(255,91,46,.16); color: var(--ok); }
.pill.big { font-size: 14px; padding: 6px 14px; }
.bar { display: block; height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* auth */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(60vw 60vw at 80% 0%, rgba(255,91,46,.08), transparent 60%), var(--bg); }
.auth-card { width: min(440px, 100%); background: var(--panel); border-radius: 18px; padding: 32px; display: grid; gap: 14px; box-shadow: 0 30px 80px -40px #000; }
.auth-logo { width: 56px; height: 56px; }

/* shell */
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; background: var(--panel); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-weight: 700; padding: 0 8px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: var(--fg); }
.side-nav a[aria-current="page"] { background: rgba(255,91,46,.12); color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.side-foot .btn { justify-content: flex-start; width: 100%; }
.side-foot form { margin: 0; }
.main { padding: 26px clamp(16px, 3vw, 40px) 80px; max-width: 1280px; width: 100%; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; }
  .side-brand span, .side-nav a span { display: none; }
  .side-nav { display: flex; }
  .side-foot { margin: 0 0 0 auto; display: flex; }
  .side-foot .btn { width: auto; }
}

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }
.page-head.sticky { position: sticky; top: 0; z-index: 10; background: rgba(15,18,20,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); margin: -26px calc(-1 * clamp(16px, 3vw, 40px)) 20px; padding: 18px clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .page-head.sticky { top: 58px; } }
body.dirty [data-save], body.dirty [data-save-settings] { box-shadow: 0 0 0 3px rgba(255,91,46,.35); }
.back { color: var(--muted); text-decoration: none; font-size: 13px; }
.card { background: var(--panel); border-radius: 16px; padding: clamp(16px, 2vw, 24px); margin-bottom: 16px; }

/* project list */
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: 28px 96px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 12px; background: var(--panel); border-radius: 12px; }
.prow.dragging { opacity: .5; outline: 2px dashed var(--accent); }
.prow.is-draft .pthumb { opacity: .55; }
.handle { color: var(--muted); cursor: grab; display: grid; place-items: center; border-radius: 6px; }
.pthumb { width: 96px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.ptitle { color: var(--fg); font-weight: 700; text-decoration: none; display: block; }
.ptitle:hover { color: var(--accent); }
.pills { display: flex; gap: 6px; }
.pactions { display: flex; gap: 4px; }
@media (max-width: 900px) {
  .prow { grid-template-columns: 24px 72px minmax(0, 1fr); }
  .pthumb { width: 72px; }
  .pills { grid-column: 3; }
  .pactions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
}

/* modal */
.modal { border: 0; padding: 26px; border-radius: 16px; background: var(--panel); color: var(--fg); width: min(460px, calc(100% - 32px)); }
.modal::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }

/* editor */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .edit-grid { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--fg); font-weight: 600; font-size: 14px; }
.chip input:checked + span { background: var(--accent); color: var(--on-accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--fg); font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 42px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.18); position: relative; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 22px; text-align: center; transition: border-color .2s, background .2s; }
.drop p { margin: 4px 0; }
.drop.over { border-color: var(--accent); background: rgba(255,91,46,.06); }
.uploads { display: grid; gap: 8px; }
.uploads:empty { display: none; }
.up { display: grid; grid-template-columns: minmax(0, 1fr) 140px 48px; gap: 10px; align-items: center; font-size: 13px; }
.up-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up.err .up-pct { color: var(--err); }
.add-link input { flex: 1; min-width: 200px; }

.mlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mlist .empty { grid-column: 1 / -1; color: var(--muted); padding: 20px; text-align: center; background: var(--panel-2); border-radius: 12px; }
.mitem { background: var(--panel-2); border-radius: 12px; overflow: hidden; display: grid; cursor: grab; }
.mitem.dragging { opacity: .5; outline: 2px dashed var(--accent); }
.mprev { position: relative; aspect-ratio: 16 / 10; background: #000; }
.mprev img, .mprev video { width: 100%; height: 100%; object-fit: cover; }
.mprev .ph { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; text-align: center; }
.mtag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.6); }
.star { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; font-size: 16px; color: #fff; background: rgba(0,0,0,.55); }
.star.on { background: var(--accent); color: var(--on-accent); }
.mbody { padding: 10px; display: grid; gap: 8px; }
.mini { font-size: 12px; padding: 7px 9px; margin: 0; }
label.mini { padding: 0; }
label.mini.check { display: flex; align-items: center; gap: 6px; font-weight: 500; }
label.mini.check input { width: auto; }
p.mini.ok { color: var(--ok); }
p.mini.warn { color: var(--warn); }

/* videos page */
.group { margin: 26px 0 10px; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.slot { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; background: var(--panel); border-radius: 12px; padding: 10px; }
.slot.has { box-shadow: inset 0 0 0 1px rgba(255,91,46,.35); }
.slot-media { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.slot-media img, .slot-media video { width: 100%; height: 100%; object-fit: cover; }
.slot-info { display: grid; gap: 6px; align-content: start; }
.slot-info .pill { justify-self: start; }

/* settings */
.rep { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; border-radius: 12px; background: var(--panel-2); margin-bottom: 10px; align-items: start; }
.rep .w2 { grid-column: span 2; }
.rep .w3 { grid-column: span 3; }
.rep .w4 { grid-column: 1 / -1; }
.rep-tools { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 4px; }
.rep-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.rep-compact .rep { grid-template-columns: minmax(0, 1fr) auto; margin: 0; padding: 12px; }
.rep-compact .rep-tools { grid-column: 1 / -1; }
@media (max-width: 760px) { .rep, .rep-compact .rep { grid-template-columns: 1fr; } .rep .w2, .rep .w3 { grid-column: auto; } }
.file-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 42px; }
.file-field img { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; background: #0e1116; padding: 4px; }
.file-field a { font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-field .bar { width: 120px; }
.hero-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.hero-list li { position: relative; background: var(--panel-2); border-radius: 10px; overflow: hidden; display: grid; gap: 6px; padding-bottom: 8px; }
.hero-list li.empty { padding: 16px; color: var(--muted); }
.hero-list img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-list .row { padding: 0 6px; }
.hero-n { position: absolute; left: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent); color: var(--on-accent); }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; max-height: 420px; overflow: auto; }
.library button { border: 0; padding: 0; background: var(--panel-2); border-radius: 8px; overflow: hidden; cursor: pointer; color: var(--muted); text-align: left; }
.library button:hover { outline: 2px solid var(--accent); }
.library img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.library span { display: block; font-size: 11px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tools */
.backups { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.backups li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel-2); border-radius: 10px; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(560px, calc(100% - 32px));
  padding: 12px 18px; border-radius: 12px; background: #262c31; color: var(--fg); font-weight: 600; box-shadow: 0 20px 50px -20px #000; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #3a2420; color: #ffd9cf; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Messages */
.side-nav a .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; line-height: 20px; text-align: center; }
.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.msg { display: grid; gap: 10px; margin: 0; }
.msg.unread { box-shadow: inset 3px 0 0 var(--accent); }
.msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.msg-head a { margin-left: 6px; word-break: break-all; }
.msg-head .pill { margin-left: 6px; background: rgba(255,91,46,.16); color: var(--accent); }
.msg-body { margin: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.55; }
.msg-actions { display: flex; gap: 8px; }

/* Language switch (panel) */
.lang-switch { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.lang-switch a { color: inherit; text-decoration: none; }
.lang-switch a:hover { color: var(--fg); text-decoration: underline; }
.lang-switch b { color: var(--fg); font-weight: 600; }
.side-foot .lang-switch { justify-content: flex-start; padding: 2px 10px; }

/* Matibox WebControl */
.wc-brand{padding:2px 8px 0}.wc-brand .wc-full{width:168px;height:auto;border-radius:0}.wc-brand .wc-icon{display:none}.auth-logo.wc-logo{width:240px;height:auto;border-radius:0;margin:0 auto 6px}
@media (max-width: 860px){.wc-brand{flex:none;padding:0 4px}.wc-brand .wc-full{display:none}.wc-brand .wc-icon{display:block;width:34px;min-width:34px;height:34px}}
