:root {
  color-scheme: light;
  --ink: #1d1d19;
  --paper: #f4f1e8;
  --orange: #ff471d;
  --line: #d5d0c2;
  --muted: #68675f;
  --surface: #fffef9;
  --shadow: 0 12px 32px rgba(29, 29, 25, 0.07);
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 0, #fbf8e9 0, transparent 32%), var(--paper);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.topbar {
  align-items: center;
  background: rgba(29, 29, 25, 0.97);
  backdrop-filter: blur(16px);
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 56px);
  position: sticky;
  top: 0;
  z-index: 20;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(22px, 3vw, 34px);
  margin-bottom: 0;
}
h2 {
  font-size: clamp(28px, 4vw, 48px);
  margin-bottom: 10px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.14em;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.topbar .eyebrow {
  color: #aaa99f;
}
.publish-box {
  align-items: center;
  display: flex;
  gap: 16px;
}
.status {
  align-items: center;
  color: #c9c8c0;
  display: inline-flex;
  font-size: 13px;
  gap: 7px;
  white-space: nowrap;
}
.status::before {
  background: #c9c8c0;
  border-radius: 50%;
  content: "";
  height: 8px;
  width: 8px;
}
.status[data-state="saving"]::before {
  background: #f4ce62;
}
.status[data-state="draft"]::before {
  background: var(--orange);
}
.status[data-state="live"]::before {
  background: #6fd596;
}
.status[data-state="error"]::before {
  background: #ff7a6e;
}
.preview-link {
  color: white;
  font-size: 13px;
  text-underline-offset: 4px;
}
.primary,
.upload-button {
  background: var(--orange);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(255, 71, 29, 0.2);
  color: var(--ink);
  display: inline-block;
  font-weight: 750;
  padding: 12px 18px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.primary:not(:disabled):hover,
.upload-button:hover {
  box-shadow: 0 8px 20px rgba(255, 71, 29, 0.3);
  transform: translateY(-1px);
}
.primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
main {
  margin: 0 auto;
  max-width: 1500px;
  padding: 28px clamp(16px, 4vw, 56px) 80px;
}
.tabs {
  background: rgba(255, 254, 249, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 4px;
  margin-bottom: 46px;
  overflow-x: auto;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
}
.tab {
  background: none;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  padding: 10px 14px;
  white-space: nowrap;
}
.tab.active {
  background: var(--ink);
  color: white;
  font-weight: bold;
}
.tab.active span {
  color: #c9c8c0;
}
.tab span {
  color: var(--muted);
  font-size: 12px;
}
.section-head {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.section-head p:last-child {
  color: var(--muted);
  max-width: 650px;
}
.dropzone {
  align-items: center;
  background: rgba(255, 254, 249, 0.6);
  border: 1px dashed #aaa697;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  margin: 28px 0;
  min-height: 120px;
  padding: 24px;
  text-align: center;
  transition: 0.15s;
}
.dropzone.dragging {
  background: #ffd8cc;
  border-color: var(--ink);
  transform: scale(0.995);
}
.dropzone span {
  color: var(--muted);
  font-size: 13px;
}
.progress {
  font-weight: bold;
  margin-top: 8px;
}
.video-log {
  background: var(--ink);
  border-radius: 8px;
  color: #f3f1e8;
  font-size: 12px;
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  white-space: pre-wrap;
}
.selection-actions {
  align-items: center;
  background: var(--ink);
  border: 1px solid #46453f;
  border-radius: 10px;
  bottom: 24px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
  color: white;
  display: flex;
  gap: 10px;
  left: 50%;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  padding: 10px 12px;
  position: fixed;
  transform: translateX(-50%);
  white-space: nowrap;
  width: max-content;
  z-index: 25;
}
.selection-actions strong {
  margin-right: auto;
}
.selection-actions button {
  background: transparent;
  border: 1px solid #77766f;
  border-radius: 6px;
  color: white;
  padding: 7px 10px;
}
.selection-actions .selection-remove {
  border-color: #ff8d84;
  color: #ffb0aa;
}
.gallery-grid {
  display: grid;
  gap: 16px;
  grid-auto-columns: minmax(180px, 230px);
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 290px);
  overflow-x: auto;
  padding: 8px 2px 24px;
}
.image-card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition:
    opacity 0.15s,
    transform 0.15s;
}
.image-card:hover {
  transform: translateY(-2px);
}
.image-card img {
  background: #ddd;
  height: 170px;
  object-fit: cover;
  width: 100%;
}
.image-card video {
  background: #000;
  display: block;
  height: 170px;
  object-fit: cover;
  width: 100%;
}
.clip-badge {
  align-self: start;
  background: var(--ink);
  border-radius: 999px;
  color: white;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 5px 8px;
}
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}
.card-body label {
  min-width: 0;
}
.card-body textarea {
  height: 54px;
  min-height: 54px;
  resize: none;
  width: 100%;
}
.position {
  background: var(--ink);
  border-radius: 999px;
  color: white;
  font-size: 10px;
  left: 8px;
  padding: 5px 8px;
  position: absolute;
  top: 8px;
}
.image-card img {
  cursor: grab;
  touch-action: none;
}
.image-card img:active {
  cursor: grabbing;
}
.image-card label,
.video-form label,
.video-fields label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: bold;
  gap: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
input,
textarea {
  background: #faf9f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 8px;
  text-transform: none;
}
textarea {
  min-height: 48px;
  resize: vertical;
}
.card-actions {
  display: flex;
  gap: 5px;
  margin-top: auto;
}
.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: inline-flex;
  justify-content: center;
  min-height: 30px;
  padding: 5px 8px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.icon-button:hover {
  background: #f1eee4;
  border-color: #aaa697;
}
.visibility-button {
  color: var(--muted);
  padding: 5px;
}
.visibility-button.active {
  color: var(--ink);
}
.visibility-button svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 17px;
}
.danger {
  color: #9c2e25;
  margin-left: auto;
}
.remove-button {
  font-size: 18px;
  line-height: 1;
  min-width: 30px;
}
.sortable-ghost {
  background: #ffd8cc;
  opacity: 0.35;
}
.sortable-drag {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  cursor: grabbing;
}
.sortable-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--orange);
}
.video-form {
  align-items: end;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 14px;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  margin: 28px 0;
  padding: 18px;
}
.video-list,
.content-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.video-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  grid-template-columns: 36px 130px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 12px;
}
.video-card .video-handle {
  background: none;
  border: 0;
  font-size: 18px;
  touch-action: none;
}
.video-card img {
  aspect-ratio: 16/9;
  border-radius: 7px;
  object-fit: cover;
  width: 100%;
}
.video-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-width: 0;
}
.inactive {
  filter: grayscale(0.65);
  opacity: 0.52;
}
.inactive:hover {
  opacity: 0.75;
}
.inactive .visibility-button {
  filter: none;
  opacity: 1;
}
.reel-preview {
  color: var(--muted);
  margin: 28px 0 0;
}
.reel-preview video {
  aspect-ratio: 16/9;
  background: #111;
  border-radius: 12px;
  display: block;
  max-width: 720px;
  width: 100%;
}
.reel-form {
  margin-top: 18px;
}
.video-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.video-actions .danger {
  margin-left: 0;
}
.add-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 28px 0;
  overflow: hidden;
}
.add-panel > summary {
  cursor: pointer;
  font-weight: bold;
  list-style-position: inside;
  padding: 16px 18px;
}
.add-panel[open] > summary {
  border-bottom: 1px solid var(--line);
}
.add-panel .video-form,
.add-panel .content-form {
  border: 0;
  border-radius: 0;
  margin: 0;
}
.add-panel .hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  padding: 0 18px 16px;
}
.add-panel .progress {
  margin: 0;
  padding: 0 18px 16px;
}
.content-form {
  align-items: end;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, 1fr) auto;
  margin: 28px 0;
  padding: 18px;
}
.content-form.compact {
  grid-template-columns: repeat(3, 1fr) auto;
}
.content-form label,
.content-fields label {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  font-weight: bold;
  gap: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.content-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  grid-template-columns: 44px 150px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 12px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    opacity 0.15s;
}
.content-card:hover {
  border-color: #c6c1b3;
  box-shadow: 0 16px 38px rgba(29, 29, 25, 0.1);
}
.content-handle {
  align-self: stretch;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: grab;
  font-size: 18px;
  touch-action: none;
}
.content-handle:hover,
.content-handle:focus-visible {
  color: var(--ink);
}
.content-handle:active {
  cursor: grabbing;
}
.content-card > img {
  background: #eee;
  border-radius: 7px;
  height: 110px;
  object-fit: contain;
  width: 150px;
}
.team-content > img {
  object-fit: cover;
}
.content-editor {
  min-width: 0;
}
.content-summary {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}
.content-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.content-summary span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
}
.content-fields {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}
.content-fields input,
.content-fields textarea,
.video-fields input {
  min-width: 0;
  width: 100%;
}
.content-fields label:has(input[type="file"]),
.video-fields label:has(input[type="file"]) {
  grid-column: 1 / -1;
}
.content-summary + .content-fields {
  margin-top: 14px;
}
.content-fields .wide {
  grid-column: 1 / -1;
}
.content-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.content-actions .danger {
  margin-left: 0;
}
.notice {
  align-items: center;
  background: var(--ink);
  border-radius: 9px;
  bottom: 24px;
  color: white;
  display: flex;
  gap: 18px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 13px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 30;
}
.notice button {
  background: none;
  border: 0;
  color: var(--orange);
  font-weight: bold;
}

@media (max-width: 800px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .publish-box {
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .preview-link {
    display: none;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .gallery-grid {
    grid-auto-columns: minmax(160px, 70vw);
    grid-template-rows: repeat(2, 270px);
  }
  .video-form {
    grid-template-columns: 1fr;
  }
  .video-list,
  .content-list {
    grid-template-columns: 1fr;
  }
  .video-card {
    grid-template-columns: 36px 110px 1fr;
  }
  .video-fields {
    grid-template-columns: 1fr;
  }
  .video-actions {
    grid-column: 2 / -1;
    justify-self: end;
  }
  .content-form,
  .content-form.compact {
    grid-template-columns: 1fr;
  }
  .content-card {
    grid-template-columns: 36px 1fr;
  }
  .content-card > img {
    height: 80px;
    width: 90px;
  }
  .content-editor {
    grid-column: 1 / -1;
    width: 100%;
  }
  .content-fields {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .content-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }
  .selection-actions {
    bottom: 16px;
  }
}
