:root {
  color-scheme: light;
  --paper: #f4f3ee;
  --surface: #fffefa;
  --ink: #242922;
  --line: #d9dbd1;
  --green: #344c32;
  --green-soft: #e2e8db;
  --muted: #757b70;
  --ochre: #ece8d9;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--green); border-radius: 4px; background: var(--green); color: white; padding: 11px 16px; transition: background .15s, transform .15s; }
button:hover { background: #263b25; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: wait; }
a { color: inherit; }
input, select, textarea { min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 11px; background: var(--surface); color: var(--ink); }
:focus-visible { outline: 3px solid #8ba078; outline-offset: 2px; }
[hidden] { display: none !important; }

.outline { border-color: var(--line); background: transparent; color: var(--ink); }
.outline:hover { background: var(--green-soft); }
.textButton { border: 0; background: transparent; color: var(--ink); padding: 8px; }
.textButton:hover { background: var(--green-soft); }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 2px; }

aside { position: fixed; inset: 0 auto 0 0; display: flex; width: 218px; flex-direction: column; padding: 35px 23px; border-right: 1px solid var(--line); background: var(--paper); }
.logo { color: var(--ink); font-size: 34px; font-weight: 850; letter-spacing: -1.6px; line-height: .95; text-decoration: none; }
.logo span { display: block; margin-top: 18px; color: var(--muted); font-size: 9px; letter-spacing: 2px; }
nav { display: grid; gap: 6px; margin-top: 68px; }
nav button { border: 0; background: transparent; color: var(--ink); padding: 11px; text-align: left; font-size: 14px; }
nav button:hover, nav button.active { background: var(--green-soft); }
nav button.active { font-weight: 650; }
.asideBottom { margin-top: auto; font: 22px/1.3 var(--serif); }
.asideBottom small { display: block; margin-top: 15px; color: var(--muted); font: 11px var(--sans); }

main { max-width: 1800px; margin-left: 218px; padding: 40px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
h1 { margin: 8px 0; font-size: 38px; letter-spacing: -1.5px; line-height: 1.12; }
header p { margin: 12px 0; color: var(--muted); font-size: 13px; }
#filters { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr .8fr 1.2fr; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--line); }
#filters > * { width: 100%; font-size: 12px; }
.selection { display: flex; min-height: 65px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
#grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; }
.card { min-width: 0; }
.photo { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 5px; background: #e9e9e3; }
.photo img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.photo .pick { position: absolute; z-index: 1; top: 12px; left: 12px; width: 22px; height: 22px; accent-color: var(--green); }
.discount { position: absolute; top: 12px; right: 12px; padding: 5px 9px; background: var(--green); color: white; font-size: 12px; }
.card .meta { margin: 14px 0 5px; color: var(--muted); font-size: 10px; letter-spacing: .6px; }
.card h2 { margin: 4px 0 10px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.price { font-size: 20px; font-weight: 650; letter-spacing: -.6px; }
.price del { margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
.sizes { margin: 9px 0; color: #4c5746; font-size: 12px; }
.cardActions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.cardActions button, .cardActions a { padding: 7px 10px; font-size: 12px; }
.cardActions a { color: var(--muted); }
.notice { margin: 9px 0; border: 1px solid #d8cfb8; border-radius: 3px; padding: 10px; background: var(--ochre); font-size: 12px; }
.empty { display: grid; min-height: 330px; grid-column: 1 / -1; place-content: center; color: var(--muted); text-align: center; }
.empty h2 { color: var(--ink); font: 30px var(--serif); }
#progress:empty { display: none; }
#progress { border-radius: 4px; padding: 12px 18px; background: var(--green-soft); font-size: 12px; }
#pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 35px; }

dialog { width: min(850px, 90vw); max-height: 90vh; border: 0; border-radius: 8px; padding: 32px; background: var(--paper); }
dialog::backdrop { background: #17201599; }
.close { float: right; border: 0; background: transparent; color: var(--ink); padding: 0 10px; font-size: 27px; }
#editorPhotos { display: flex; overflow: auto; gap: 10px; margin: 20px 0; }
#editorPhotos img { max-width: 220px; height: 220px; object-fit: contain; background: white; }
.postPreview { max-width: 560px; margin-top: 18px; border-radius: 8px; padding: 16px; background: #172635; color: #f2f5f7; white-space: pre-wrap; overflow-wrap: anywhere; }
.postPreviewBrand { margin-bottom: 8px; color: #78df84; font-weight: 700; }
.postPreview a { color: #79c5ff; }
.postPreview s, .postPreview del { color: #a8afb5; }
label { display: grid; gap: 6px; font-size: 12px; }
textarea { width: 100%; resize: vertical; }
small { color: var(--muted); font-size: 11px; }
.editorActions { display: flex; flex-wrap: wrap; align-items: end; gap: 15px; margin-top: 20px; }
#editorError, #loginError { margin-top: 12px; color: #97402b; }
#toast { position: fixed; z-index: 5; right: 25px; bottom: 25px; max-width: 420px; border-radius: 5px; padding: 18px 24px; background: var(--ink); color: white; }
#login { display: grid; min-height: 100vh; place-items: center; }
#login form { width: min(400px, 90vw); }
#login h1 { margin-bottom: 35px; font-size: 47px; }
#login h1 span { display: block; margin-top: 20px; font: 30px/1.3 var(--serif); }
#login button { width: 100%; margin-top: 20px; }

@media (min-width: 1550px) { #grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  aside { width: 175px; padding: 25px 15px; }
  main { margin-left: 175px; padding: 25px; }
  #filters { grid-template-columns: repeat(3, 1fr); }
  #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  aside { position: static; width: auto; padding: 20px; border-right: 0; }
  .logo { font-size: 22px; }
  .logo br { display: inline; }
  .logo span, .asideBottom { display: none; }
  nav { display: flex; overflow: auto; gap: 5px; margin-top: 20px; }
  nav button { flex: 0 0 auto; white-space: nowrap; font-size: 12px; }
  main { margin: 0; padding: 18px; }
  h1 { font-size: 28px; }
  header { display: block; }
  header > button { margin-top: 10px; font-size: 12px; }
  #filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 12px; }
  .price { font-size: 17px; }
  .card h2 { font-size: 13px; }
  .cardActions button { padding: 7px; font-size: 11px; }
  .selection { align-items: flex-start; gap: 10px; padding: 12px 0; }
  .selection > div { display: flex; flex-wrap: wrap; }
  .editorActions { display: grid; }
  dialog { padding: 20px; }
}
