@font-face {
  font-family: Onest;
  src: url("../fonts/onest-cyrillic-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  src: url("../fonts/onest-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Onest;
  src: url("../fonts/onest-cyrillic-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  src: url("../fonts/onest-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Onest;
  src: url("../fonts/onest-cyrillic-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  src: url("../fonts/onest-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #161a4e;
  --blue: #2d88ff;
  --paper: #f3f5f9;
  --white: #fff;
  --lime: #aedc0c;
  --muted: #555a7a;
  --line: rgba(22, 26, 78, 0.12);
  --mat: #e6ebf3;
  --font: Onest, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
}

* { box-sizing: border-box; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin: 0; }
ol { margin: 0; padding: 0; list-style: none; }
::placeholder { color: #6f7590; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--paper);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 5;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--white);
  font-weight: 700;
}
.skip:focus { top: 12px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.logo {
  margin: 0;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.045em;
  line-height: 1;
}
.logo span { color: var(--blue); }

.shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
}

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
.top h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.save-note {
  margin-right: auto;
  margin-left: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.textlink {
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.textlink:hover { text-decoration: underline; }

.btn, .btn-primary {
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.btn {
  background: var(--white);
  border: 1px solid rgba(22, 26, 78, 0.14);
}
.btn:hover { background: #f8f9fc; }
.btn-primary {
  background: #1667db;
  border: 0;
  color: #fff;
}
.btn-primary:hover { background: #1258bd; }
.btn:disabled, .btn-primary:disabled {
  background: #e1e6ef;
  color: var(--muted);
  border-color: transparent;
  cursor: default;
}
.btn:active, .btn-primary:active { transform: scale(0.985); }
.btn-quiet {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
}
.btn-quiet:hover { background: rgba(22, 26, 78, 0.05); }

.work {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 340px;
  min-height: 0;
  overflow: hidden;
}

.rail {
  padding: 16px 12px;
  border-right: 1px solid var(--line);
}
.rail button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 4px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: left;
}
.rail button[aria-current="page"] {
  background: var(--white);
  box-shadow: 0 8px 20px rgba(22, 26, 78, 0.06);
}
.rail .count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#board {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 28px 32px 64px;
}
#board:focus { outline: none; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.panel-head h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.panel-head p {
  max-width: 48ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}
.panel[hidden] { display: none; }

.callout {
  max-width: 62ch;
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--white);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  max-width: 720px;
  margin-top: 20px;
}
.settings.one { grid-template-columns: 240px; }
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
  margin-top: 20px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field[hidden] { display: none; }
.field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}
.field input, .field textarea {
  width: 100%;
  border: 1px solid rgba(22, 26, 78, 0.14);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--white);
  font-size: 16px;
  font-weight: 500;
}
.field textarea { min-height: 108px; resize: vertical; }
.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.range {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range input { accent-color: var(--ink); width: 100%; }
.range output {
  min-width: 2ch;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  font-weight: 700;
}
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.check small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.empty:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 36ch;
  margin-top: 28px;
}
.empty-mark {
  width: 56px;
  height: 84px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background:
    linear-gradient(var(--paper), var(--paper)) 8px 10px / 40px 8px no-repeat,
    linear-gradient(#fff, #fff) 8px 24px / 40px 40px no-repeat;
}
.empty-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.empty p { color: var(--muted); font-size: 15px; font-weight: 500; line-height: 1.4; }

.list { margin-top: 16px; }
.list[hidden] { display: none; }
.row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  padding: 6px 8px 6px 4px;
  border-radius: 16px;
}
.row:hover { background: rgba(255, 255, 255, 0.72); }
.row.is-picked {
  background: var(--white);
  box-shadow: 0 10px 28px rgba(22, 26, 78, 0.07);
}
.row.is-drop { box-shadow: inset 0 -2px 0 var(--ink); }
.row.is-off .thumb,
.row.is-off .row-title { opacity: 0.45; }
.idx {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.row-main {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.row.no-thumb .row-main { grid-template-columns: minmax(0, 1fr); }
.row-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title {
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta { color: var(--muted); font-size: 13px; font-weight: 500; }
.thumb {
  display: block;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
  background: var(--white);
}
.row-actions { display: flex; gap: 2px; }
.icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.icon:hover { background: rgba(22, 26, 78, 0.06); }
.icon:disabled { opacity: 0.28; }
.icon svg { width: 18px; height: 18px; }

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 18px 18px 0;
  border-left: 1px solid var(--line);
  background: var(--mat);
}
.device-wrap {
  flex: 0 0 auto;
  padding-bottom: 4px;
  background: var(--mat);
}
.device {
  width: min(220px, 100%);
  margin: 0 auto;
  padding: 10px;
  border-radius: 28px;
  background: #10122a;
  box-shadow: 0 22px 50px rgba(16, 18, 42, 0.22);
}
.device-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 18px;
  background: var(--paper);
}
.device-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--white);
  font-size: 11px;
  font-weight: 700;
}
.device-flag[hidden] { display: none; }
.device-top { padding: 8px 10px 0; }
.device-top .logo { font-size: 14px; }
.device-reel {
  height: 58px;
  margin-top: 6px;
  overflow: hidden;
}
.device-track {
  display: flex;
  gap: 8px;
  width: max-content;
  padding-left: 10px;
  animation: device-reel var(--reel-time, 96s) linear infinite;
}
.device-track img {
  width: 36px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--white);
}
.device-ad {
  position: relative;
  width: calc(100% - 28px);
  margin: 8px auto 0;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(22, 26, 78, 0.08);
}
.device-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.device-copy {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 24px;
  z-index: 1;
}
.device-logo { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -0.04em; }
.device-logo span { color: var(--blue); }
.device-eye {
  margin: 0;
  color: var(--blue);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.device-ad.is-lime .device-eye { color: var(--ink); }
.device-h {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.device-hl {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--lime);
}
.device-ad.is-lime .device-hl { background: var(--ink); color: var(--lime); }
.device-p {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: rgba(22, 26, 78, 0.72);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.3;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.device-empty {
  padding: 20px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.device-tap {
  align-self: center;
  margin: auto 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 6px 14px rgba(22, 26, 78, 0.07);
  font-size: 11px;
  font-weight: 700;
}
.device-caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
#editor {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 28px;
}

.editor {
  margin-top: 16px;
  padding: 20px;
  border-radius: 28px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(22, 26, 78, 0.05);
}
.editor h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.editor .check { margin-top: 16px; }
.editor .field { margin-top: 16px; }
.editor-empty {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}
.seg {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
}
.seg label {
  position: relative;
  flex: 1;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.seg label:has(input:checked) {
  background: var(--white);
  box-shadow: 0 4px 12px rgba(22, 26, 78, 0.08);
}
.seg label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.shot {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  aspect-ratio: 16 / 10;
}
.shot.is-poster { max-width: 180px; aspect-ratio: 3 / 4; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}
.editor-foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
audio { width: 100%; margin-top: 8px; }

dialog {
  width: min(760px, calc(100% - 48px));
  max-height: 86vh;
  padding: 22px;
  overflow: auto;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  font: inherit;
  box-shadow: 0 24px 80px rgba(16, 18, 42, 0.24);
}
dialog::backdrop { background: rgba(16, 18, 42, 0.45); }
#confirm { width: min(440px, calc(100% - 48px)); }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dialog-head h2, #confirm h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
#confirm p { margin-top: 10px; color: var(--muted); font-weight: 500; line-height: 1.4; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.picker-tools { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.igrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  max-height: 46vh;
  margin-top: 14px;
  overflow: auto;
}
.pick {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  text-align: left;
}
.pick img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pick-name {
  padding: 4px 6px 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  max-width: 340px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 30px rgba(16, 18, 42, 0.2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.desk-lock {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  max-width: 28rem;
  padding: 32px;
}
.desk-lock h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.desk-lock .lead {
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
}

@keyframes device-reel {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .device-track { animation: none; }
  .btn:active, .btn-primary:active { transform: none; }
}

@media (max-width: 1179px) {
  body { height: auto; overflow: auto; }
  .shell { display: none; }
  .desk-lock { display: flex; }
}
