:root {
  --ink: #0a285c;
  --muted: #53627a;
  --paper: #f7f4ed;
  --line: rgba(10, 40, 92, .15);
  --coral: #ff6f6a;
  --blue: #1775ee;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.editor-header { min-height: 82px; padding: 16px clamp(18px, 4vw, 54px); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: white; background: var(--ink); position: sticky; top: 0; z-index: 10; }
.editor-brand { display: inline-flex; align-items: center; gap: 11px; }
.editor-brand > span { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink); background: white; border-radius: 50%; }
.editor-brand strong { font: 800 1.05rem/1.2 "Manrope", sans-serif; }
.editor-brand small { display: block; margin-top: 3px; opacity: .62; font: 500 .7rem/1.2 "DM Sans", sans-serif; }
.editor-header nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.editor-header nav a, .editor-header button { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.42); border-radius: 999px; color: white; background: transparent; font-size: .78rem; font-weight: 700; }
.editor-header button.primary { color: var(--ink); background: var(--coral); border-color: var(--coral); }
.editor-header button:disabled { opacity: .35; cursor: not-allowed; }
#status { margin-right: 5px; font-size: .75rem; opacity: .72; }

.editor-layout { min-height: calc(100vh - 82px); display: grid; grid-template-columns: 285px minmax(0, 1fr); }
aside { padding: 24px 16px; background: #fffdf8; border-right: 1px solid var(--line); }
.content-tabs { padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #eae7df; border-radius: 12px; }
.content-tabs button { padding: 9px 7px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: .78rem; font-weight: 700; }
.content-tabs button[aria-selected="true"] { color: white; background: var(--ink); }
.list-heading { margin: 24px 3px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; }
.list-heading button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--blue); background: white; font-size: .7rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.list-heading button:disabled { opacity: .4; }
.order-help { margin: -4px 3px 12px; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.item-list { display: grid; gap: 6px; }
.item-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border: 1px solid transparent; border-radius: 10px; color: var(--ink); background: transparent; }
.item-row:hover { background: #f2efe8; }
.item-row.active { color: white; background: var(--ink); }
.item-row.dragging { opacity: .4; }
.item-row.drop-before::before, .item-row.drop-after::after { content: ""; position: absolute; right: 4px; left: 4px; height: 3px; border-radius: 3px; background: var(--blue); }
.item-row.drop-before::before { top: -5px; }
.item-row.drop-after::after { bottom: -5px; }
.item-select { min-width: 0; padding: 11px 8px 11px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; color: inherit; background: transparent; text-align: left; }
.item-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-order { padding-right: 7px; display: flex; align-items: center; gap: 2px; }
.item-order button { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 7px; color: inherit; background: rgba(255,255,255,.55); font-weight: 800; }
.item-row.active .item-order button { background: rgba(255,255,255,.14); }
.item-order button:hover:not(:disabled) { color: white; background: var(--blue); }
.item-order button:disabled { opacity: .28; cursor: not-allowed; }
.drag-handle { padding: 4px 1px 4px 4px; color: inherit; opacity: .45; cursor: grab; font-weight: 800; letter-spacing: -3px; }
.drag-handle:active { cursor: grabbing; }
.item-list small { opacity: .64; }
.empty-list { padding: 30px 12px; color: var(--muted); text-align: center; font-size: .82rem; }

main { width: 100%; max-width: 1100px; padding: clamp(28px, 5vw, 64px); }
.locked { max-width: 650px; padding-top: 10vh; }
.eyebrow { margin: 0 0 15px; color: var(--coral); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0 0 16px; font: 800 clamp(2.3rem, 5vw, 4.3rem)/1 "Manrope", sans-serif; letter-spacing: -.06em; }
.locked > p:last-child { max-width: 560px; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.editor-title { margin-bottom: 32px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.editor-title h1 { margin: 0; font-size: clamp(2.1rem, 4vw, 3.4rem); }
.editor-actions { display: flex; gap: 7px; }
.icon-button { min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-weight: 800; }
.icon-button.danger { color: #a33c3c; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .visibility label { font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 13px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; outline: 0; }
.field textarea { min-height: 118px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,117,238,.12); }
.visibility { min-height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.visibility input { width: 18px; height: 18px; accent-color: var(--blue); }
.photo-preview { min-height: 250px; overflow: hidden; display: grid; place-items: center; color: var(--muted); background: #eaf6fb; border: 1px solid var(--line); border-radius: 16px; }
.photo-preview.full { grid-column: 1 / -1; }
.photo-preview img { width: 100%; height: 100%; max-height: 430px; object-fit: contain; }
.icon-preview { min-height: 145px; padding: 18px; display: grid; place-items: center; color: var(--muted); background: #eaf6fb; border: 1px solid var(--line); border-radius: 16px; }
.icon-preview.full { grid-column: 1 / -1; }
.icon-preview img { width: 110px; height: 110px; object-fit: contain; }
.editor-empty { padding: 70px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; text-align: center; }
.instructions { max-width: 800px; margin-top: 52px; padding: 18px 20px; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 13px; color: var(--muted); }
.instructions summary { color: var(--ink); font-weight: 800; }
.instructions ol { margin: 16px 0 0; padding-left: 22px; line-height: 1.65; }

@media (max-width: 800px) {
  .editor-header { align-items: flex-start; }
  .editor-header nav { max-width: 65%; }
  #status { width: 100%; text-align: right; }
  .editor-layout { grid-template-columns: 1fr; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  .item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 30px 18px 50px; }
}

@media (max-width: 560px) {
  .editor-header { position: static; display: grid; }
  .editor-header nav { max-width: none; justify-content: flex-start; }
  #status { text-align: left; }
  .item-list, .fields { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .editor-title { display: grid; }
}
