/* Editor: same type and palette as the site, tuned for filling in forms */
body.is-editor { background: var(--ivory); }
body.is-editor .masthead, body.is-editor .mainnav, body.is-editor .foot { display: none; }

.ed { min-height: 100vh; display: flex; flex-direction: column; }
.ed__top { display: flex; align-items: center; gap: 20px; padding: 13px clamp(16px, 3vw, 32px); background: #fff; border-bottom: 1px solid var(--hair); }
.ed__logo { font: italic 500 26px/1 var(--mast); }
.ed__logo span { font: 500 11px/1 var(--sans); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); margin-left: 6px; }
.ed__demo { flex: 1; font-size: 12px; color: var(--muted); }
.ed__topactions { display: flex; gap: 8px; }
.ed__body { flex: 1; display: grid; grid-template-columns: 200px 1fr; }
.ed__nav { display: flex; flex-direction: column; gap: 2px; padding: 24px 14px; background: #fff; border-right: 1px solid var(--hair); font-size: 14px; }
.ed__nav a { padding: 8px 12px; border-radius: 3px; transition: background .15s, color .15s; }
.ed__nav a:hover { background: var(--ivory); }
.ed__nav a[aria-current="page"] { background: var(--stone); font-weight: 500; }
.ed__nav .ed__exit { margin-top: auto; color: var(--muted); font-size: 13px; }
.ed__main { padding: clamp(20px, 3vw, 40px); max-width: 1120px; width: 100%; }

.ed__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.ed__head h1 { font: 500 clamp(30px, 3vw, 38px)/1.1 var(--serif); }
.ed__head p { font-size: 13px; color: var(--soft); margin-top: 4px; }
.ed__crumb a { font-size: 12.5px; border-bottom: 1px solid var(--hair); }
.ed__crumb a::before { content: "\2190\00a0"; }
.ed__notice { background: #fff; border-left: 3px solid var(--accent); padding: 11px 14px; font-size: 13.5px; margin-bottom: 18px; }
.ed__notice a { text-decoration: underline; }
.ed__errors { background: #fbeceb; border-left: 3px solid var(--error); padding: 11px 14px; font-size: 13.5px; margin-bottom: 18px; }

.btn { display: inline-block; padding: 9px 15px; border: 1px solid var(--rule); border-radius: 3px; background: #fff; font: 500 13px/1.2 var(--sans); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; cursor: pointer; }
.btn:hover { background: var(--stone); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #3a231c; border-color: #3a231c; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--soft); }
.btn--danger { border-color: transparent; background: transparent; color: var(--error); }
.btn--danger:hover { background: #fbeceb; }

.chip { display: inline-block; padding: 4px 9px; border-radius: 3px; font: 500 11px/1.2 var(--sans); white-space: nowrap; }
.chip--draft { background: var(--stone); color: var(--soft); }
.chip--review { background: var(--blue); color: #2c4152; }
.chip--published { background: var(--ink); color: #fff; }

.edlist { background: #fff; border: 1px solid var(--hair); }
.edrow { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--hair); transition: background .15s; }
.edrow:last-child { border-bottom: 0; }
.edrow:hover { background: var(--ivory); }
.edrow__thumb { width: 64px; height: 46px; background: var(--stone); overflow: hidden; }
.edrow__text { min-width: 0; }
.edrow__text strong { display: block; font: 500 18px/1.2 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edrow__text span { font-size: 12px; color: var(--muted); }

.edform { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(20px, 3vw, 40px); align-items: start; }
.edform--single { grid-template-columns: minmax(0, 620px); }
.edform__fields { display: flex; flex-direction: column; gap: 16px; }
.edform__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.edform__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--hair); }
.edform__spacer { flex: 1; }
.field label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; }
.field__hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fielderror { font-size: 12.5px; color: var(--error); margin-top: 4px; }
.ed input[type="text"], .ed select, .ed textarea { width: 100%; padding: 9px 11px; border: 1px solid #cfccc1; border-radius: 3px; background: #fff; font: 400 14.5px/1.5 var(--sans); color: var(--ink); }
.ed textarea { resize: vertical; line-height: 1.7; }
.ed input:focus, .ed select:focus, .ed textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.ed [aria-invalid="true"] { border-color: var(--error); }

.dropzone { position: relative; display: grid; place-items: center; min-height: 190px; border: 1px dashed #b5b2a6; border-radius: 3px; background: #fff; overflow: hidden; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--ivory); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone > img { position: absolute; inset: 0; }
.dropzone__text { position: relative; padding: 14px; font-size: 14px; font-weight: 500; }
.dropzone__text small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--muted); }
.dropzone.has-photo { min-height: 260px; }
.dropzone.has-photo .dropzone__text { align-self: end; margin-bottom: 12px; padding: 7px 12px; background: rgba(255, 255, 255, .92); border-radius: 3px; }
.dropzone.is-busy { opacity: .55; pointer-events: none; }
.dropzone.is-busy .dropzone__text::after { content: " Compressing…"; }
.dropzone__saved { margin-top: 7px; font-size: 12.5px; color: var(--soft); }
.dropzone__saved strong { color: var(--ink); font-weight: 600; margin-right: 6px; }

.preview { position: sticky; top: 20px; }
.preview__label { font: 500 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px; }
.preview__card { background: #fff; border: 1px solid var(--hair); }
.preview__img { aspect-ratio: 3 / 2; display: grid; place-items: center; background: var(--stone); color: var(--soft); font-size: 12px; overflow: hidden; }
.preview__cap { padding: 14px; }
.preview__cap h3 { font: 500 24px/1.16 var(--serif); margin: 5px 0 7px; overflow-wrap: anywhere; }
.preview__cap > p:last-child { font-size: 12.5px; line-height: 1.6; color: var(--soft); overflow-wrap: anywhere; }

.edtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.edtabs a { padding: 7px 12px; border: 1px solid var(--hair); border-radius: 3px; background: #fff; font-size: 13px; }
.edtabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.memberrow { display: grid; grid-template-columns: 22px 52px 1fr 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; background: #fff; border: 1px solid var(--hair); border-bottom: 0; }
#ed-members .memberrow:last-child { border-bottom: 1px solid var(--hair); }
.memberrow.is-dragging { position: relative; z-index: 1; background: var(--ivory); box-shadow: 0 6px 20px rgba(29, 29, 27, .14); }
.memberrow__grip { display: grid; place-items: center; width: 22px; height: 40px; border-radius: 3px; color: var(--muted); cursor: grab; touch-action: none; transition: color .15s, background .15s; }
.memberrow__grip:hover, .memberrow__grip:focus-visible { color: var(--ink); background: var(--stone); }
.memberrow__grip svg { width: 10px; height: 16px; fill: currentColor; }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; }
.edform__status { font-size: 12.5px; color: var(--soft); }
.memberrow__photo { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--stone); overflow: hidden; font-size: 9px; line-height: 1.1; text-align: center; color: var(--soft); cursor: pointer; }
.memberrow__photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.memberrow__photo:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Public-site additions driven by the editor */
.emptytrip { text-align: center; margin-top: 24px; font-size: 14px; color: var(--muted); }
.team__empty { text-align: center; margin-top: 24px; font-size: 14px; color: var(--muted); }
.team--plain { padding-top: clamp(40px, 5vw, 64px); }
.livetoast { position: fixed; z-index: 60; left: 50%; bottom: 24px; translate: -50% 0; padding: 10px 16px; background: var(--ink); color: #fff; font-size: 13px; border-radius: 3px; animation: livetoast 3.4s ease both; pointer-events: none; }
@keyframes livetoast { 0% { opacity: 0; transform: translateY(8px); } 8%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }

@media (max-width: 860px) {
  .ed__demo { display: none; }
  .ed__top { justify-content: space-between; }
  .ed__body { grid-template-columns: 1fr; }
  .ed__nav { flex-direction: row; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--hair); white-space: nowrap; }
  .ed__nav .ed__exit { margin: 0 0 0 auto; }
  .edform { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; order: -1; }
  .memberrow { grid-template-columns: 22px 44px 1fr auto; }
  .memberrow__grip { grid-row: 1 / span 2; height: 100%; }
  .memberrow__photo { grid-row: 1 / span 2; }
  .memberrow input[data-member="role"] { grid-column: 3; grid-row: 2; }
  .memberrow .btn { grid-column: 4; grid-row: 1 / span 2; padding-inline: 4px; }
}
@media (max-width: 480px) {
  .ed__topactions .btn--quiet { display: none; }
  .edrow { grid-template-columns: 48px 1fr; }
  .edrow .chip { grid-column: 2; justify-self: start; }
  .edrow__thumb { width: 48px; }
  .edform__pair { grid-template-columns: 1fr; }
}
