:root {
  font-family: Arial, sans-serif;
  color: #1b1d19;
  background: #f6f6f3;
  font-synthesis: none;
  --ink: #1b1d19;
  --muted: #6b7065;
  --line: #dedfd7;
  --lime: #d5ff3f;
  scrollbar-gutter: stable;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
input, textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 0; background: #fff; font-size: 13px; line-height: 1.5; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--ink); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
label { display: block; font-size: 12px; line-height: 1.5; font-weight: 600; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #6a7b20; outline-offset: 3px; }
.wrap { width: min(1320px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 10; padding: 12px 20px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 96px; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 27px; font-weight: 800; letter-spacing: -1.6px; line-height: 1; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.text-link { color: var(--muted); font-size: 12px; line-height: 1.5; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 16px; border: 1px solid transparent; border-radius: 0; font-size: 12px; font-weight: 600; line-height: 1.5; text-align: center; }
.button-dark { color: #fff; background: var(--ink); }
.button-dark:hover:not(:disabled) { background: #3a4032; }
.button-outline { background: transparent; border-color: var(--line); }
.button-outline:hover:not(:disabled) { border-color: var(--ink); }
.button-lime { background: var(--lime); }
.button-lime:hover:not(:disabled) { background: #e0ff77; }
.button-danger { border-color: #a95a43; background: #fff; color: #873e2b; }
.button-danger:hover:not(:disabled) { border-color: #873e2b; background: #f8eee9; }
.text-button { min-height: 36px; padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.5; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover:not(:disabled) { color: var(--ink); }
.main { padding-block: 35px 56px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { font-size: 30px; line-height: 1.25; font-weight: 600; letter-spacing: -.8px; }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.6; }
.messages { margin-bottom: 22px; }
.notice { padding: 12px 14px; border-left: 3px solid #859435; background: #ecefe2; color: #46542c; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.notice + .notice { margin-top: 10px; }
.notice-error { border-color: #a95a43; color: #78412e; background: #f4eae4; }
.messages .text-button { margin-top: 8px; }
.panel { border: 1px solid var(--line); background: #fff; }
.auth-panel { width: min(480px, 100%); margin: 42px auto; padding: 28px; }
.auth-panel h2 { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
.auth-description { margin-top: 12px; }
.auth-form { margin-top: 24px; }
.auth-form label { margin-bottom: 8px; }
.auth-form label:not(:first-child) { margin-top: 18px; }
.auth-form .button { width: 100%; margin-top: 24px; }
.field-help { color: var(--muted); font-size: 11px; line-height: 1.6; font-weight: 400; }
.auth-form .field-help { margin-top: 7px; }
.draft-preserved, #setup-link-needed { margin-top: 20px; }
.editor-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 24px; }
.build-sidebar { position: sticky; top: 20px; max-height: calc(100dvh - 40px); padding: 18px; overflow: auto; }
.sidebar-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.sidebar-heading h2 { font-size: 17px; font-weight: 600; }
.new-build { width: 100%; margin-bottom: 14px; }
.new-build[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--ink); }
.build-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.build-select { display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; padding: 8px; border: 1px solid transparent; background: #f6f6f3; text-align: left; }
.build-select:hover:not(:disabled) { border-color: var(--line); }
.build-select[aria-current="true"] { border-color: var(--ink); box-shadow: inset 3px 0 var(--lime); }
.build-select img { flex: 0 0 52px; width: 52px; height: 42px; object-fit: contain; background: #ecece7; }
.build-select-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.build-select-title { font-size: 12px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.build-select-meta { color: var(--muted); font-size: 10px; line-height: 1.5; }
.empty-list { margin-top: 18px; }
.empty-editor { padding-block: 12px 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-editor .button { margin-top: 18px; }
.editor-main { min-width: 0; padding: 26px; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.editor-heading h2 { font-size: 23px; line-height: 1.35; font-weight: 600; letter-spacing: -.5px; overflow-wrap: anywhere; }
.dirty-label { flex-shrink: 0; padding: 5px 8px; background: #f1f3e7; color: #5e692e; font-size: 10px; line-height: 1.5; }
.field { margin-bottom: 20px; }
.field > label { margin-bottom: 7px; }
.field > .field-help { margin-top: 6px; }
.field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 7px; }
.checkboxes { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-block: 24px 28px; }
.checkbox { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 12px; font-weight: 400; }
.editor-section { padding-block: 24px; border-top: 1px solid var(--line); }
.editor-section h3 { font-size: 16px; line-height: 1.4; font-weight: 600; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-help { margin-top: 9px; }
.detail-rows { display: flex; flex-direction: column; gap: 12px; }
.detail-row { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(180px, 2fr) 40px; align-items: end; gap: 10px; }
.detail-row label { font-size: 10px; font-weight: 400; color: var(--muted); margin-bottom: 5px; }
.row-field { min-width: 0; }
.remove-row { width: 40px; min-height: 43px; padding: 0; border: 1px solid var(--line); background: #fff; font-size: 22px; line-height: 1; }
.remove-row:hover:not(:disabled) { border-color: var(--ink); }
.photo-order { display: flex; flex-direction: column; gap: 12px; padding: 0; margin: 18px 0 0; list-style: none; }
.photo-upload { margin-top: 18px; padding: 16px; border: 1px solid var(--line); background: #f8f8f5; }
.photo-upload > label { margin-bottom: 8px; }
.photo-upload > input { padding: 9px; background: #fff; }
.photo-upload > .field-help { margin-top: 9px; }
.photo-upload input::file-selector-button { margin-right: 12px; padding: 8px 10px; border: 1px solid var(--line); background: #f6f6f3; color: var(--ink); font: inherit; cursor: pointer; }
.upload-queue { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.upload-queue:empty { display: none; }
.upload-item { display: flex; align-items: center; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.upload-details { min-width: 0; flex: 1; }
.upload-name { font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.upload-failed .field-help, .upload-rejected .field-help { color: #873e2b; }
.upload-item progress { display: block; width: 100%; height: 8px; margin-top: 8px; accent-color: #738520; }
.photo-row { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--line); background: #f8f8f5; }
.photo-row img { width: 110px; height: 78px; flex: 0 0 110px; object-fit: contain; background: #ecece7; }
.photo-details { display: flex; flex-direction: column; gap: 9px; min-width: 0; flex: 1; }
.photo-name { font-size: 12px; line-height: 1.4; }
.photo-cover { display: inline-block; margin-left: 8px; padding: 3px 6px; background: var(--lime); font-size: 10px; line-height: 1.4; }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.move-photo { width: 36px; min-height: 36px; padding: 0; border: 1px solid var(--line); background: #fff; font-size: 18px; line-height: 1; }
.move-photo:hover:not(:disabled) { border-color: var(--ink); }
.cover-button { min-height: 36px; padding: 6px 10px; font-size: 11px; }
.remove-photo { font-size: 11px; }
.save-bar { position: sticky; bottom: 0; z-index: 1; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--line); background: #fff; }
.save-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 11px; }
.danger-zone { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.danger-zone h3 { margin-bottom: 9px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.danger-zone .button { margin-top: 14px; }
.confirm-dialog { width: min(470px, calc(100% - 32px)); padding: 28px; border: 1px solid var(--line); background: #f6f6f3; color: var(--ink); }
.confirm-dialog::backdrop { background: #13170fbd; }
.confirm-dialog h2 { font-size: 22px; font-weight: 600; line-height: 1.35; letter-spacing: -.5px; }
.confirm-dialog p { margin-top: 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.confirm-dialog strong { color: var(--ink); overflow-wrap: anywhere; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

@media (max-width: 1050px) {
  .editor-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 18px; }
  .editor-main { padding: 22px; }
  .build-sidebar { padding: 14px; }
  .detail-row { grid-template-columns: minmax(90px, 1fr) minmax(130px, 1.6fr) 40px; }
}

@media (max-width: 760px) {
  input, textarea { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .header { min-height: 84px; gap: 16px; }
  .wordmark { font-size: 25px; }
  .header-actions { gap: 12px; }
  .header-actions .text-link { font-size: 10px; }
  .header-actions .button { min-height: 38px; padding: 8px 11px; font-size: 11px; }
  .main { padding-top: 26px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-heading h1 { font-size: 26px; }
  .editor-layout { grid-template-columns: 1fr; gap: 18px; }
  .build-sidebar { position: static; max-height: 300px; padding: 16px; }
  .build-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .build-select { gap: 8px; }
  .build-select img { flex-basis: 42px; width: 42px; height: 38px; }
  .build-select-title { font-size: 11px; }
  .editor-main { padding: 20px; }
  .editor-heading h2 { font-size: 21px; }
  .photo-row { gap: 12px; }
  .photo-row img { width: 84px; height: 70px; flex-basis: 84px; }
}

@media (max-width: 480px) {
  .header { align-items: flex-start; flex-direction: column; padding-block: 22px 18px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .header-actions .text-link { font-size: 12px; }
  .auth-panel { margin-top: 25px; padding: 22px; }
  .editor-main { padding: 17px; }
  .editor-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .build-list { grid-template-columns: 1fr; }
  .build-sidebar { max-height: 260px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .detail-row { position: relative; grid-template-columns: minmax(0, 1fr) 40px; align-items: end; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid #eeeee8; }
  .detail-row .row-field:first-child { grid-column: 1 / -1; }
  .detail-row .row-field:nth-child(2) { grid-column: 1; }
  .remove-row { grid-column: 2; }
  .photo-row { align-items: flex-start; padding: 10px; gap: 10px; }
  .photo-row img { width: 65px; height: 60px; flex-basis: 65px; }
  .photo-cover { margin-left: 0; margin-top: 5px; }
  .photo-name { display: flex; align-items: flex-start; flex-direction: column; }
  .cover-button { flex-basis: 100%; text-align: left; justify-content: flex-start; }
  .save-actions { flex-direction: column; }
  .save-actions .button { width: 100%; }
  .confirm-dialog { padding: 24px; }
  .confirm-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
