:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #607067;
  --paper: #f3f1e9;
  --panel: #fffdf7;
  --line: #d8d5c9;
  --accent: #176b4d;
  --accent-dark: #0e4b35;
  --danger: #9b3129;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select { font: inherit; }
button {
  border: 0; border-radius: .55rem; padding: .7rem 1rem; color: white;
  background: var(--accent); cursor: pointer; font-weight: 700;
}
button:hover { background: var(--accent-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }
.button-secondary { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.button-danger { background: var(--danger); }
input, select {
  width: 100%; border: 1px solid var(--line); border-radius: .5rem;
  background: white; padding: .68rem .75rem; color: var(--ink);
}
label { display: block; margin: .8rem 0 .35rem; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .25rem; }
.eyebrow { margin-bottom: .2rem; color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.shell { width: min(1120px, calc(100% - 2rem)); margin: 1.5rem auto 4rem; }
.shell--narrow { width: min(440px, calc(100% - 2rem)); margin-top: 10vh; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.panel { padding: 1.25rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--panel); box-shadow: 0 8px 30px rgb(23 33 28 / 5%); }
.panel--wide { grid-column: 1 / -1; }
.panel button { margin-top: .8rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem max(1rem, calc((100% - 1120px) / 2)); border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar button { margin: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.section-heading h2 { margin-bottom: 0; }
.batch-actions { display: flex; align-items: center; gap: .6rem; }
.batch-actions button { margin-top: 0; }
.status { min-height: 1.4em; margin: .75rem 0 0; color: var(--muted); }
.status[data-error="true"] { color: var(--danger); }
.cards, .queue { display: grid; gap: .75rem; }
.card, .queue-item { padding: .9rem; border: 1px solid var(--line); border-radius: .65rem; background: white; }
.card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card p { margin-bottom: .2rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; margin-top: 1rem; }
.photo-card { border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; background: white; }
.photo-card[hidden] { display: none; }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #ebe9df; }
.private-preview { position: relative; margin: 0; }
.private-preview figcaption {
  position: absolute; z-index: 1; top: .55rem; left: .55rem; margin: 0;
  border-radius: 999px; padding: .28rem .55rem; color: white; background: rgb(23 33 28 / 82%);
  font-size: .72rem; font-weight: 800; letter-spacing: .035em;
}
.private-preview--source { background: #ebe9df; }
.private-preview--output { margin-top: .7rem; border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; }
.private-preview--output figcaption { background: rgb(23 107 77 / 90%); }
.photo-body { padding: .9rem; }
.photo-body h3 { margin: 0 0 .3rem; font-size: 1rem; overflow-wrap: anywhere; }
.photo-body > input, .photo-body > select, .photo-body > button { margin-top: .55rem; }
.photo-body > button { width: 100%; }
.assignment { padding: .55rem; border-radius: .45rem; background: #e7f3ed; }
.search-results { display: grid; gap: .35rem; margin-top: .5rem; }
.search-result { width: 100%; text-align: left; color: var(--ink); background: #f0efe9; }
.search-result[aria-pressed="true"] { color: white; background: var(--accent); }
.inline-check { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 600; }
.inline-check input { width: auto; }
.back-link { color: var(--accent); text-decoration: none; font-weight: 700; }
.detail, .summary { color: var(--muted); }
.output-workflow { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--line); }
.output-workflow h4 { margin: 0 0 .5rem; font-size: 1rem; }
.output-workflow > button { width: 100%; }
.output-metadata, .selected-output { display: block; margin: .45rem 0; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.output-status { padding: .55rem; border-radius: .45rem; background: #f0efe9; }
.publication-state { margin: .7rem 0; padding: .7rem; border: 1px solid var(--line); border-radius: .55rem; }
.publication-state p { margin: .35rem 0 0; }
.publication-state--pending { border-color: #8b7a4f; background: #faf5e8; }
.publication-state--publishing { border-color: #b38b2f; background: #fff8df; }
.publication-state--succeeded { border-color: var(--accent); background: #e7f3ed; }
.publication-state--failed { border-color: var(--danger); background: #fff0ee; }
.publication-state--indeterminate { border: 2px solid var(--danger); background: #fff0ee; }
.publication-confirmation { margin-top: .8rem; padding: .8rem; border: 2px solid var(--danger); border-radius: .65rem; background: #fff8f5; }
.publication-confirmation dl { display: grid; grid-template-columns: minmax(5.5rem, auto) 1fr; gap: .3rem .65rem; margin: .65rem 0; }
.publication-confirmation dt { font-weight: 800; }
.publication-confirmation dd { margin: 0; overflow-wrap: anywhere; }
.publication-warning { padding: .65rem; color: #6f1f1a; background: #ffe0dc; border-radius: .45rem; font-weight: 800; }
.publication-confirmation .button-danger { width: 100%; }
.catalog-search { width: min(28rem, 100%); margin: 0; color: var(--muted); font-size: .85rem; }
.catalog-search input { margin-top: .35rem; }
.destination-tree { display: grid; gap: .7rem; margin-top: 1rem; }
.tree-level { border: 1px solid var(--line); border-radius: .7rem; background: #faf9f3; }
.tree-level > summary { cursor: pointer; padding: .85rem; color: var(--accent-dark); font-weight: 800; }
.tree-level > .tree-level { margin: 0 .7rem .7rem; background: white; }
.tree-level > .destination-card { margin: 0 .7rem .7rem; }
.destination-card { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(15rem, 2fr); gap: .75rem; align-items: center; padding: .75rem; border: 1px solid var(--line); border-radius: .65rem; background: white; }
.destination-card[hidden], .tree-level[hidden] { display: none; }
.destination-heading { display: grid; gap: .22rem; min-width: 0; }
.destination-heading strong { overflow-wrap: anywhere; }
.destination-heading span { color: var(--muted); font-size: .78rem; }
.destination-drop { position: relative; display: grid; place-items: center; min-height: 7.5rem; overflow: hidden; border: 2px dashed #9fb2a7; border-radius: .6rem; padding: .65rem; color: var(--muted); background: #f5faf7; text-align: center; cursor: pointer; }
.destination-drop[data-dragover="true"] { border-color: var(--accent); background: #dff2e8; }
.destination-drop img { width: 100%; height: 9rem; object-fit: cover; border-radius: .35rem; }
.ready-badge { position: absolute; top: .45rem; right: .45rem; border-radius: 999px; padding: .25rem .55rem; color: white; background: var(--accent); font-size: .72rem; font-weight: 800; }
.destination-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .45rem; }
.destination-actions button { margin: 0; }
.destination-publication { grid-column: 1 / -1; margin: 0; padding: .5rem .65rem; border-radius: .45rem; font-size: .82rem; font-weight: 700; }
.destination-publication--succeeded { color: var(--accent-dark); background: #e7f3ed; }
.destination-publication--failed, .destination-publication--indeterminate { color: var(--danger); background: #fff0ee; }
.special-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .8rem; }
.special-grid .destination-card { grid-template-columns: 1fr; align-content: start; }
.special-grid .destination-actions, .special-grid .destination-publication { grid-column: auto; }
[data-readonly="true"] .destination-drop { cursor: default; border-style: solid; }
.reuse-dialog { width: min(720px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); border: 0; border-radius: .85rem; padding: 0; box-shadow: 0 22px 70px rgb(0 0 0 / 28%); }
.reuse-dialog::backdrop { background: rgb(10 16 12 / 58%); }
.reuse-shell { padding: 1.25rem; }
.reuse-targets { display: grid; gap: .4rem; max-height: 45vh; overflow: auto; margin: .8rem 0; }
.reuse-choice { display: flex; align-items: flex-start; gap: .55rem; margin: 0; padding: .6rem; border: 1px solid var(--line); border-radius: .5rem; background: white; font-weight: 600; }
.reuse-choice input { width: auto; margin-top: .18rem; }
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .panel--wide { grid-column: auto; }
  .section-heading, .card, .batch-actions { align-items: stretch; flex-direction: column; }
  .destination-card { grid-template-columns: 1fr; }
  .destination-actions, .destination-publication { grid-column: auto; }
}
