:root {
  color-scheme: dark;
  --bg: #18171a;
  --side: #151417;
  --panel: #222126;
  --panel-up: #29282e;
  --ink: #f6f3eb;
  --muted: #b7b2be;
  --line: #3a3840;
  --lime: #e2fa75;
  --amber: #ffce91;
  --danger: #ffc0bb;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.035em; line-height: 1.05; }
h1 { font-size: clamp(2.75rem, 5.2vw, 5.45rem); font-weight: 780; }
h2 { font-size: clamp(1.42rem, 2.75vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { line-height: 1.5; }
small, .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { min-height: 100dvh; position: sticky; top: 0; height: 100dvh; background: var(--side); border-right: 1px solid var(--line); padding: 31px 18px 22px; display: flex; flex-direction: column; gap: 25px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 7px; font-size: .99rem; font-weight: 800; letter-spacing: .035em; }
.brand small { display: block; font-size: .62rem; letter-spacing: .22em; padding-top: 3px; }
.mark { flex: 0 0 37px; width: 37px; height: 37px; background: var(--lime); color: #141615; border-radius: 9px; display: inline-flex; gap: 3px; align-items: center; justify-content: center; }
.mark i { width: 3px; border-radius: 2px; height: 11px; background: currentColor; }
.mark i:nth-child(2) { height: 20px; }
.mark i:nth-child(3) { height: 15px; }
.profile { margin-top: 4px; background: #232226; border: 1px solid var(--line); color: var(--ink); width: 100%; padding: 12px 10px; border-radius: 8px; font-size: .88rem; font-weight: 680; }
nav { display: grid; gap: 6px; }
nav a { min-height: 43px; display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 7px; color: var(--muted); font-size: .9rem; font-weight: 560; }
nav a span { width: 16px; text-align: center; font-size: 1rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); background: var(--panel-up); }
nav a[aria-current="page"] span, #nav-alert { color: var(--lime); }
#nav-alert { margin-left: auto; font-size: .72rem; }
.foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 5px 0; font-size: .76rem; color: var(--muted); }
.foot span { color: var(--lime); }
.top { height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 0 clamp(20px,4vw,60px); color: var(--muted); font-size: .86rem; }
.top strong { color: var(--ink); font-weight: 680; }
.top .divider { margin: 0 8px; }
.page { max-width: 1540px; margin: auto; padding: 33px clamp(20px,4vw,60px) 55px; }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 292px; display: flex; align-items: flex-end; background: linear-gradient(120deg,#343140,#222127 75%); border: 1px solid #44404a; border-radius: 16px; }
.hero img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #121116f5 4%, #131218cb 37%, #18151f23 100%), linear-gradient(0deg,#12111699,transparent 58%); }
.hero-inner { padding: clamp(21px,4vw,50px); }
.hero h1 { margin: .15em 0; max-width: 850px; }
.eyebrow { font-size: .75rem; font-weight: 750; color: var(--lime); text-transform: uppercase; letter-spacing: .16em; }
.hero p { color: #e4dfe8; max-width: 570px; font-size: .95rem; }
.hero .button { margin-top: 23px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 29px 0 16px; }
.section-head p, .heading p { color: var(--muted); margin-top: 7px; font-size: .91rem; }
.heading { margin: 3px 0 23px; }
.heading h1 { font-size: clamp(2.6rem, 5vw, 4.65rem); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 13px; font-size: .83rem; font-weight: 730; border-radius: 7px; border: 1px solid transparent; white-space: nowrap; line-height: 1.2; text-align: center; }
.primary { color: #191c0f; background: var(--lime); }
.primary:hover { background: #ecff9e; }
.secondary { color: var(--ink); background: var(--panel); border-color: #49464f; }
.secondary:hover { background: #32303a; }
.button:disabled { opacity: .48; cursor: default; }
.link { color: var(--muted); background: none; border: 0; padding: 8px 0; font-size: .83rem; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }
.post-grid, .asset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.card { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--panel); border-radius: 11px; }
.poster { height: clamp(132px, 17vw, 259px); position: relative; overflow: hidden; background: linear-gradient(120deg,#38333c,#26272b); }
.poster img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 41%; }
.poster .tag { position: absolute; top: 10px; left: 10px; background: #151419e8; }
.poster .length { position: absolute; bottom: 10px; right: 10px; font-size: .72rem; font-weight: 700; background: #151419de; padding: 5px 7px; border-radius: 5px; }
.tag { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 720; padding: 5px 7px; color: var(--ink); background: #38353e; border-radius: 5px; white-space: nowrap; }
.tag.draft { background: #393d26; color: var(--lime); }
.tag.manual_ready, .tag.check { color: var(--amber); }
.tag.failed { color: var(--danger); }
.card-body { padding: 14px; }
.card-body h3 { margin: 9px 0 7px; overflow-wrap: anywhere; }
.card-body p { font-size: .81rem; color: var(--muted); }
.card-body .button { margin-top: 13px; }
.card-body .lead { color: var(--ink); }
.batch { margin-bottom: 25px; }
.below { margin-top: 22px; }
.empty { padding: 24px; }
.empty p { margin: 9px 0 13px; color: var(--muted); }
.panel { padding: clamp(15px,3vw,26px); background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.toolbar, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { margin: 0 0 16px; }
.toolbar input { max-width: 270px; }
#toast { position: fixed; bottom: 20px; right: 20px; z-index: 4; max-width: min(460px,calc(100vw - 40px)); padding: 13px 15px; border-radius: 8px; border: 1px solid #63674d; background: #333625; color: var(--ink); box-shadow: 0 8px 27px #0007; font-size: .9rem; }
#toast.error { border-color: #956561; background: #422e30; }
.notice { border-left: 3px solid var(--amber); margin-bottom: 16px; padding: 10px 12px; color: var(--amber); background: #332b25; border-radius: 4px; font-size: .9rem; }
.rows { display: grid; gap: 0; }
.row { display: grid; grid-template-columns: minmax(118px,.74fr) minmax(170px,1.4fr) minmax(128px,1fr) auto; align-items: center; gap: 11px; padding: 14px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.row:last-child { padding-bottom: 0; }
.row > div small { display: block; margin-top: 4px; }
.row .button { justify-self: end; }
.settings { display: grid; gap: 13px; }
.settings h2 { font-size: 1.4rem; margin-bottom: 10px; }
.settings p { font-size: .9rem; color: var(--muted); }
.settings .check { margin-top: 12px; }
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 26px); border: 1px solid #514d58; border-radius: 14px; background: var(--panel); color: var(--ink); padding: 0; }
dialog.wide { width: min(945px, calc(100vw - 24px)); }
dialog::backdrop { background: #0c0b10bf; }
.modal-top { position: sticky; top: 0; z-index: 1; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; }
.modal-top h2 { font-size: 1.45rem; }
.modal-main { padding: 18px 20px 21px; }
form { display: grid; gap: 12px; }
label { font-size: .87rem; font-weight: 650; color: var(--ink); display: grid; gap: 5px; }
input, textarea, select { width: 100%; color: var(--ink); border: 1px solid #514e59; border-radius: 6px; min-height: 39px; padding: 8px 9px; background: #19181d; }
input[type=checkbox] { width: 16px; min-height: 16px; margin: 0; accent-color: var(--lime); }
input[type=file] { min-height: 52px; padding: 12px 8px; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-grid, .editor { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; display: flex; gap: 13px; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: .85rem; }
.form-error:empty { display: none; }
.hint { color: var(--muted); font-size: .83rem; }
.editor video, .editor .slide, .source-preview { display: block; width: 100%; max-height: 64dvh; object-fit: contain; background: #151419; border-radius: 7px; }
.editor .slide { aspect-ratio: 4/5; }
.editor .preview-actions { justify-content: center; margin: 10px 0; }
.editor .media-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cut { display: grid; grid-template-columns: minmax(90px,1fr) 65px 65px auto; align-items: end; gap: 5px; margin-bottom: 7px; }
.cut.carousel { grid-template-columns: minmax(90px,1fr) 65px auto; }
.cut .button { min-height: 39px; }
.cut select, .cut input { font-size: .75rem; padding: 6px 4px; }
summary { cursor: pointer; padding: 8px 0; color: var(--lime); font-size: .86rem; }
progress { accent-color: var(--lime); width: 100%; }
.login { padding: 24px; min-height: 100dvh; display: grid; place-items: center; }
.login form { width: min(390px,100%); }
.login h1 { font-size: 2.1rem; margin-bottom: 7px; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 174px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .page { padding-inline: 24px; }
  .row { grid-template-columns: 100px 1.2fr 1fr auto; }
}
@media (max-width: 690px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; padding: 12px 16px; gap: 10px; }
  nav { grid-column: 1/-1; display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; }
  nav a { justify-content: center; padding: 5px 3px; min-height: 36px; font-size: .73rem; gap: 4px; }
  nav a span, #nav-alert { width: auto; }
  .foot { display: none; }
  .profile { margin: 0; max-width: 153px; min-height: 36px; padding: 5px; }
  .top { height: 59px; padding-inline: 16px; }
  .page { padding: 18px 16px 31px; }
  .hero { min-height: 243px; }
  .asset-grid, .post-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .section-head { align-items: flex-start; }
  .section-head > .button { white-space: normal; }
  .row { grid-template-columns: 1fr 1.25fr; }
  .row .button { justify-self: start; }
  .editor { grid-template-columns: minmax(0,1fr); }
  .editor video, .editor .slide { max-height: 44dvh; }
}
@media (max-width: 370px) { .top .divider, .top .handle { display: none; } .cut { gap: 3px; grid-template-columns: minmax(78px,1fr) 57px 57px auto; } }
