:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #edf7f1;
  background: #030806;
  font-synthesis: none;
  --surface: #09150f;
  --surface-raised: #10231a;
  --line: #244a37;
  --green: #42a472;
  --green-bright: #6bd59b;
  --muted: #99aa9f;
  --danger: #ee806f;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #030806; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.topbar {
  min-height: 92px;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d3a25;
  border-bottom: 1px solid #1d6544;
}
.topbar h1, h2, h3, p { margin-top: 0; }
.topbar h1 { margin-bottom: 0; font-size: 1.55rem; }
.eyebrow { margin-bottom: 5px; color: var(--green-bright); font-size: .73rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.identity { display: flex; align-items: center; gap: 14px; color: #d6eee0; }

.center-card {
  width: min(520px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
}
.center-card p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }

.workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: calc(100vh - 92px); }
.queue-panel { padding: 24px; background: #06100b; border-right: 1px solid var(--line); }
.panel-heading, .editor-heading, .section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.filter-label { display: block; margin: 18px 0 7px; color: var(--muted); font-size: .82rem; }
.listing-list { display: grid; gap: 10px; margin-top: 18px; }
.listing-card { width: 100%; padding: 11px; text-align: left; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 11px; align-items: center; }
.listing-card:hover, .listing-card.active { border-color: var(--green); background: #0c1c14; }
.listing-card strong, .listing-card span { display: block; }
.listing-card-copy { min-width: 0; }
.listing-card strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-card-copy > span { margin-top: 7px; color: var(--muted); font-size: .8rem; }
.listing-card-thumb { width: 58px; height: 58px; border-radius: 9px; object-fit: cover; background: #020704; border: 1px solid var(--line); }

.editor { max-width: 1120px; width: 100%; padding: 34px 42px 110px; margin: 0 auto; }
.empty-state { display: grid; place-content: center; min-height: 65vh; text-align: center; color: var(--muted); }
.form-section { margin-top: 22px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.form-section h3 { margin-bottom: 18px; }
.form-section .section-heading p { color: var(--muted); font-size: .86rem; }
label { display: grid; gap: 8px; margin-top: 16px; color: #cfe4d6; font-size: .9rem; font-weight: 700; }
input, textarea, select { width: 100%; padding: 12px 13px; color: #f2faf5; background: #020604; border: 1px solid #315943; border-radius: 10px; outline: none; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(107,213,155,.12); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-row.three { grid-template-columns: 2fr 1fr 1fr; }
.field-hint { justify-self: end; color: var(--muted); font-size: .75rem; }
.required { color: var(--green-bright); }

.specific-tabs { display: flex; gap: 5px; margin-top: 16px; padding: 4px; overflow-x: auto; background: #020604; border: 1px solid var(--line); border-radius: 12px; }
.specific-tab { flex: 1 0 auto; padding: 9px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; font-weight: 800; }
.specific-tab[aria-selected="true"] { color: #edf7f1; background: var(--surface-raised); box-shadow: inset 0 0 0 1px #315943; }
.specific-tab:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 1px; }
.specific-tab.has-missing { color: #f0c674; }
.tab-count { display: inline-grid; min-width: 1.55em; height: 1.55em; margin-left: 4px; padding: 0 5px; place-items: center; color: #d8eee1; background: #193528; border-radius: 999px; font-size: .72rem; }
.specific-summary { min-height: 1.2em; margin: 10px 2px 0; color: var(--green-bright); font-size: .78rem; }
.specific-summary.has-missing { color: #f0c674; }
.specific-panel[hidden] { display: none; }
.specific-row { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(200px, 1.8fr) auto; gap: 10px; margin-top: 10px; align-items: center; }
.specific-name-cell { min-width: 0; }
.specific-name-cell input { width: 100%; }
.aspect-badge { color: var(--muted); font-size: .7rem; margin-left: -8px; }
.aspect-badge.required { color: #f0c674; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo-grid figure { position: relative; margin: 0; aspect-ratio: 1; overflow: hidden; background: #020604; border: 1px solid var(--line); border-radius: 12px; cursor: grab; }
.photo-grid figure.dragging { opacity: .45; border-color: var(--green-bright); }
.photo-grid figure.main-photo { border: 2px solid var(--green-bright); }
.photo-grid img { width: 100%; height: 100%; object-fit: contain; }
.photo-grid figcaption { position: absolute; left: 7px; top: 7px; padding: 4px 7px; color: #031109; background: var(--green-bright); border-radius: 999px; font-size: .72rem; font-weight: 900; }
.photo-order-controls { position: absolute; right: 7px; bottom: 7px; display: flex; gap: 5px; }
.photo-order-controls button { width: 34px; height: 31px; padding: 0; color: var(--text); background: rgba(3, 17, 9, .88); border: 1px solid var(--green); border-radius: 7px; font-weight: 900; }
.photo-order-controls button:disabled { opacity: .3; }

.status-pill { padding: 7px 11px; color: var(--green-bright); background: rgba(66,164,114,.13); border: 1px solid var(--green); border-radius: 999px; font-size: .8rem; font-weight: 800; }
.action-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; margin: 28px -12px -86px; padding: 18px 12px; background: rgba(3,8,6,.94); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.action-delete { margin-right: auto; }
.button, .icon-button { padding: 11px 16px; color: #edf7f1; border-radius: 10px; border: 1px solid transparent; font-weight: 800; }
.button-primary { color: #021108; background: var(--green-bright); }
.button-subtle, .icon-button { background: #10231a; border-color: #315943; }
.button-danger { color: #ffd8d1; background: #3a1714; border-color: #7c372e; }
.icon-button { padding: 8px 12px; font-size: 1.1rem; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.message { color: var(--green-bright); }
.error { min-height: 1.2em; color: var(--danger); }

dialog { width: min(620px, calc(100% - 30px)); padding: 0; color: inherit; background: transparent; border: 0; }
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(4px); }
.dialog-card { padding: 28px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 18px; }
.dialog-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .topbar { padding: 17px 18px; }
  .workspace { grid-template-columns: 1fr; }
  .queue-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .editor { padding: 24px 16px 100px; }
  .field-row, .field-row.three { grid-template-columns: 1fr; }
  .action-bar { flex-wrap: wrap; }
}
