:root {
  --ink: #282532;
  --muted: #716e7c;
  --purple: #7253bd;
  --lilac: #eee8fa;
  --border: #e7e4ea;
  --bg: #faf9f6;
  --green: #317764;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    15px/1.6 Inter,
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--purple);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #a788d0;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.loading {
  padding: 60px;
  text-align: center;
}
.login {
  max-width: 460px;
  padding: 34px;
  margin: 10vh auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 23px;
  letter-spacing: -0.6px;
}
.brand img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}
.brand small {
  display: block;
  font-weight: 450;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0;
}
.login h1 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.8px;
  margin: 28px 0 12px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.3px;
  font-weight: 700;
  color: var(--purple);
}
.stack {
  display: grid;
  gap: 18px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.button {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: white;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 13px;
}
.button.secondary {
  color: var(--purple);
  background: var(--lilac);
}
.button.ghost {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
}
.button.danger {
  color: #a5414e;
  background: #faebef;
}
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 12px;
  border: 1px solid #dcd5e4;
  background: white;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--purple);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 450;
}
.check input {
  flex-shrink: 0;
  margin-top: 4px;
}
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
  background: white;
  border-right: 1px solid var(--border);
  padding: 25px 20px;
}
.sidebar nav {
  margin-top: 28px;
}
.sidebar details {
  margin-top: 10px;
}
.sidebar summary {
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #78707f;
  cursor: pointer;
}
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  min-height: 42px;
}
.nav-item.active {
  color: var(--purple);
  background: var(--lilac);
  font-weight: 700;
}
.nav-item:hover {
  background: #f5f2fa;
}
.sidebar-foot {
  padding: 22px 10px;
  border-top: 1px solid var(--border);
  margin-top: 25px;
  font-size: 12px;
  color: var(--muted);
}
.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 19px 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.topbar .row {
  gap: 17px;
}
.badge {
  display: inline-block;
  background: var(--lilac);
  color: var(--purple);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.PUBLISHED,
.badge.APPROVED {
  background: #e8f3ec;
  color: var(--green);
}
.badge.SUBMITTED,
.badge.CHANGES_REQUESTED {
  background: #fcedde;
  color: #995b24;
}
.badge.ARCHIVED {
  background: #eee;
  color: #777;
}
.badge.REJECTED {
  background: #faebef;
  color: #a5414e;
}
.content {
  padding: 34px;
  max-width: 1350px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head h1 {
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 7px 0;
}
.page-head p {
  margin: 7px 0 0;
  color: var(--muted);
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 25px;
  border-radius: 17px;
}
.card h2 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 15px;
}
.notice {
  background: var(--lilac);
  border-radius: 11px;
  padding: 15px 18px;
  font-size: 13px;
  color: #604d77;
}
.notice.warning {
  background: #fcedde;
  color: #86521f;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 19px;
}
.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}
.metric {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
  margin: 10px 0;
  color: var(--purple);
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th {
  text-align: left;
  background: #f5f2f8;
  color: #817687;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 16px;
}
td {
  border-top: 1px solid #eee9f2;
  padding: 16px;
  vertical-align: middle;
}
td strong {
  font-weight: 600;
}
td .button {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 36px;
}
.empty {
  padding: 40px;
  text-align: center;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 24px;
  align-items: start;
}
.editor-sidebar {
  position: sticky;
  top: 20px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.toolbar input {
  max-width: 350px;
}
.editor-actions {
  position: sticky;
  bottom: 0;
  background: #faf9f6f2;
  backdrop-filter: blur(8px);
  padding: 18px 0;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  margin-top: 25px;
}
.node-card {
  padding: 20px;
  background: #f7f4fa;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.node-card h3 {
  margin: 0 0 15px;
  font-size: 16px;
}
.choice-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}
.node-tools {
  margin-top: 15px;
}
.video-preview {
  width: 100%;
  max-height: 280px;
  background: #2d263e;
  border-radius: 12px;
}
.url {
  max-width: 260px;
  overflow-wrap: anywhere;
}
.flag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.flag:last-child {
  border-bottom: 0;
}
.flag p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 480px;
  background: #2d263e;
  color: white;
  padding: 17px 23px;
  border-radius: 13px;
  z-index: 30;
  box-shadow: 0 10px 30px #0002;
}
#toast.error {
  background: #923c4c;
}
.review-text {
  white-space: pre-wrap;
  line-height: 1.8;
}
.errors {
  color: #a5414e;
  font-size: 13px;
}
@media (max-width: 1050px) {
  .layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .sidebar {
    padding: 20px 12px;
  }
  .content {
    padding: 24px;
  }
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-sidebar {
    position: static;
  }
  .grid,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brand {
    font-size: 20px;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 700px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }
  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow: auto;
    margin-top: 16px;
  }
  .sidebar details {
    margin: 0;
    min-width: 100px;
  }
  .sidebar summary {
    font-size: 11px;
  }
  .sidebar details:not([open]) .nav-item {
    display: none;
  }
  .sidebar-foot {
    display: none;
  }
  .topbar {
    padding: 15px 20px;
  }
  .content {
    padding: 22px 16px;
  }
  .page-head h1 {
    font-size: 28px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .metric {
    font-size: 28px;
  }
  #toast {
    right: 16px;
    left: 16px;
    bottom: 16px;
  }
  .login {
    margin: 6vh 16px;
  }
  .button {
    padding: 10px 14px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
