:root {
  --ink: #0d1219;
  --panel: #151b24;
  --panel-2: #1c2430;
  --line: #2f3948;
  --paper: #f7f7f7;
  --muted: #aab1bc;
  --pink: #ed1a62;
  --green: #42d392;
  --amber: #ffbd59;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--paper);
  background: var(--ink);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}
.mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  background: var(--pink);
  font-size: 36px;
  font-weight: 950;
  transform: rotate(-3deg);
  box-shadow: 7px 7px 0 #fff;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #0a0e14;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 2px 6px 34px;
}
.brand .mark {
  width: 40px;
  height: 40px;
  font-size: 23px;
  box-shadow: 4px 4px 0 #fff;
}
.brand strong {
  display: block;
  letter-spacing: 0.08em;
}
.brand small {
  color: var(--muted);
}
.nav {
  display: grid;
  gap: 8px;
}
.nav button {
  text-align: left;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  background: transparent;
  font-weight: 700;
}
.nav button:hover,
.nav button.active {
  color: white;
  border-color: var(--line);
  background: var(--panel);
}
.nav button.active::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--pink);
}
.account {
  margin-top: auto;
  padding: 14px 8px 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.main {
  min-width: 0;
  padding: 34px 42px 110px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 28px;
}
.eyebrow {
  color: var(--pink);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
h1 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.93;
  margin: 7px 0 0;
  letter-spacing: -0.055em;
}
.muted {
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.button {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 14px;
  color: white;
  background: var(--panel-2);
  font-weight: 750;
}
.button:hover {
  border-color: #697588;
}
.button.primary {
  background: var(--pink);
  border-color: var(--pink);
}
.button.ghost {
  background: transparent;
}
.button.danger {
  color: #ff8eab;
}
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.button.small {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(390px, 1.3fr);
  gap: 18px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  overflow: hidden;
}
.panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 16px;
}
.project-list {
  max-height: calc(100vh - 245px);
  overflow: auto;
  padding: 8px;
}
.project-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: white;
  background: transparent;
}
.project-item:hover,
.project-item.active {
  border-color: var(--line);
  background: var(--panel-2);
}
.project-item.dragging {
  opacity: 0.45;
}
.project-item .grip {
  color: #697588;
  cursor: grab;
  font-size: 16px;
}
.project-item strong,
.project-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-item small {
  margin-top: 2px;
  color: var(--muted);
}
.order-buttons {
  display: flex;
  flex-direction: column;
}
.order-buttons button {
  border: 0;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  line-height: 1;
}

.editor {
  padding: 20px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.field.full {
  grid-column: 1 / -1;
}
.form-grid > .full {
  grid-column: 1 / -1;
}
.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  color: white;
  background: #0f151d;
  outline: none;
}
.field textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.5;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(237, 26, 98, 0.12);
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}
.check input {
  accent-color: var(--pink);
  width: 17px;
  height: 17px;
}

.media-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 5px;
}
.drop {
  min-height: 116px;
  border: 1px dashed #596579;
  border-radius: 11px;
  padding: 14px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  background: #101720;
  transition: 0.2s;
}
.drop:hover,
.drop.over {
  border-color: var(--pink);
  background: rgba(237, 26, 98, 0.06);
}
.drop input {
  display: none;
}
.drop strong {
  display: block;
  color: white;
  font-size: 13px;
}
.drop small {
  display: block;
  margin-top: 5px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #657084;
}
.status.ready .dot {
  background: var(--green);
}
.status.error .dot {
  background: var(--pink);
}
.status.processing .dot,
.status.waiting .dot,
.status.uploading .dot {
  background: var(--amber);
}
.progress {
  height: 4px;
  border-radius: 3px;
  background: #313a49;
  overflow: hidden;
  margin-top: 8px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--pink);
}

.carousel-summary {
  min-width: 150px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.carousel-summary strong,
.carousel-summary span {
  display: block;
}
.carousel-summary strong {
  color: var(--pink);
  font-size: 26px;
  line-height: 1;
}
.carousel-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.carousel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.carousel-stage,
.available-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.section-intro {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.section-intro h2,
.section-intro p {
  margin: 0;
}
.section-intro p {
  max-width: 650px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.carousel-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}
.carousel-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101720;
  overflow: hidden;
}
.carousel-card.dragging {
  opacity: 0.48;
}
.carousel-card-head {
  display: grid;
  grid-template-columns: 24px 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.carousel-card-head .grip {
  color: #697588;
  cursor: grab;
}
.carousel-card-head strong,
.carousel-card-head small,
.available-item strong,
.available-item small {
  display: block;
}
.carousel-card-head small,
.available-item small {
  margin-top: 2px;
  color: var(--muted);
}
.carousel-number {
  color: var(--pink);
  font-size: 12px;
  font-weight: 850;
}
.order-buttons.horizontal {
  flex-direction: row;
  gap: 4px;
}
.order-buttons.horizontal button {
  padding: 5px;
}
.carousel-assets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
}
.carousel-asset {
  position: relative;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #131b25;
}
.asset-preview {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #070a0f center / cover no-repeat;
  overflow: hidden;
}
.carousel-asset.mobile .asset-preview {
  width: 50px;
  justify-self: center;
  aspect-ratio: 9 / 16;
}
.asset-preview span {
  padding: 3px 5px;
  border-radius: 5px;
  color: #fff;
  background: #000a;
  font-size: 9px;
  font-weight: 850;
}
.asset-copy strong,
.asset-copy .status {
  display: flex;
}
.asset-copy .status {
  margin-top: 6px;
}
.asset-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 7px;
}
.upload-button {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.upload-button input {
  display: none;
}
.carousel-asset > .progress {
  grid-column: 1 / -1;
  width: 100%;
}
.edit-pack {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #101720;
}
.edit-pack.pending {
  color: var(--muted);
}
.edit-pack strong,
.edit-pack small {
  display: block;
}
.edit-pack small {
  max-width: 620px;
  margin-top: 3px;
  color: var(--muted);
}
.edit-pack-links {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.approval-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #0d141d;
}
.approval-row strong,
.approval-row small {
  display: block;
}
.approval-row small {
  margin-top: 3px;
  color: var(--muted);
}
.approval-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: max-content;
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.approval-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}
.approval-check:has(input:disabled) {
  color: var(--muted);
  opacity: 0.6;
}
.available-panel {
  position: sticky;
  top: 22px;
}
.available-list {
  max-height: calc(100vh - 260px);
  padding: 8px;
  overflow: auto;
}
.available-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.available-item > span {
  min-width: 0;
}
.empty-state {
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
}
.empty-state.compact {
  padding: 20px 10px;
  font-size: 13px;
}

.copy-grid {
  display: grid;
  gap: 16px;
  max-width: 900px;
}
.copy-card,
.person-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.copy-card h2,
.person-card h2 {
  margin: 0 0 16px;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.person-card .form-grid {
  grid-template-columns: 1fr 1fr;
}

.publish-bar {
  position: fixed;
  z-index: 20;
  left: 238px;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 42px;
  border-top: 1px solid var(--line);
  background: rgba(10, 14, 20, 0.94);
  backdrop-filter: blur(16px);
}
.save-state {
  color: var(--muted);
  font-size: 13px;
}
.save-state strong {
  color: white;
}
.toast {
  position: fixed;
  z-index: 60;
  top: 18px;
  right: 18px;
  max-width: 420px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #202a38;
  box-shadow: 0 15px 50px #0008;
}
.toast.error {
  border-color: var(--pink);
}
.drawer-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: #0009;
}
.drawer {
  position: fixed;
  z-index: 41;
  top: 0;
  right: 0;
  width: min(440px, 92vw);
  height: 100vh;
  padding: 24px;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #10161f;
}
.revision {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.revision strong,
.revision small {
  display: block;
}
.revision small {
  margin: 5px 0 10px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .rail {
    position: static;
    width: 100%;
    height: auto;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    margin: 0 0 12px;
  }
  .nav {
    grid-template-columns: repeat(4, 1fr);
  }
  .nav button {
    text-align: center;
    padding: 10px 5px;
  }
  .account {
    display: none;
  }
  .main {
    padding: 26px 18px 120px;
  }
  .project-layout {
    grid-template-columns: 1fr;
  }
  .carousel-layout {
    grid-template-columns: 1fr;
  }
  .available-panel {
    position: static;
  }
  .available-list {
    max-height: 360px;
  }
  .project-list {
    max-height: 340px;
  }
  .publish-bar {
    left: 0;
    padding: 13px 18px;
  }
}

@media (max-width: 600px) {
  .page-head {
    align-items: start;
    flex-direction: column;
  }
  .form-grid,
  .people-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .media-grid {
    grid-template-columns: 1fr;
  }
  .carousel-card-head {
    grid-template-columns: 22px 26px minmax(0, 1fr) auto;
  }
  .carousel-card-head > .danger {
    grid-column: 3 / -1;
    justify-self: start;
  }
  .carousel-assets {
    grid-template-columns: 1fr;
  }
  .edit-pack {
    align-items: stretch;
    flex-direction: column;
  }
  .approval-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .edit-pack-links {
    justify-content: flex-start;
  }
  .publish-bar .save-state {
    display: none;
  }
}
