:root {
  --canvas: #FBF7F0; --paper: #F3ECDF; --ink: #141414; --ink-2: #3a3733; --muted: #7a7268;
  --red: #D7262E; --blue: #2457A6; --sun: #F2B705; --green: #2f7a3a; --line: rgba(20,20,20,.14);
  --serif: "Fraunces", Georgia, serif; --sans: "DM Sans", system-ui, sans-serif; --hand: "Caveat", cursive;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1 { font: 400 clamp(2rem, 5vw, 3rem)/1.05 var(--serif); margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font: 400 1.4rem/1.15 var(--serif); margin: 0 0 4px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: .88rem; }
.center { text-align: center; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--ink); color: var(--canvas); display: flex; align-items: center; gap: 16px; padding: 10px 16px; flex-wrap: wrap; }
.top__logo { display: flex; align-items: center; gap: 6px; text-decoration: none; }
.top__logo img { width: 64px; filter: invert(1); }
.top__logo span { font: 600 1.5rem/1 var(--hand); color: var(--sun); }
.top__nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.top__nav a { text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.top__nav a:hover, .top__nav a.is-active { background: rgba(255,255,255,.12); }
.badge { display: inline-block; background: var(--red); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  padding: 12px 18px; min-height: 48px; border-radius: 12px; border: 2px solid var(--ink);
  background: var(--ink); color: var(--canvas); font-weight: 700; font-size: 1rem;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn--red { background: var(--red); color: #fff; }
.btn--green { background: var(--green); color: #fff; }
.btn--ghost { background: #fff; color: var(--ink); }
.btn--big { min-height: 58px; font-size: 1.08rem; padding: 14px 24px; }
.btn--wide { width: 100%; }
.mini { min-height: 40px; min-width: 40px; padding: 6px 10px; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; font-size: .95rem; }
.mini:hover { border-color: var(--ink); }
.mini--danger { color: var(--red); }
.mini--danger:hover { border-color: var(--red); background: #fdecec; }

/* flash */
.flash { padding: 14px 18px; border-radius: 12px; margin: 0 0 20px; font-weight: 500; background: #e9f4e6; border: 2px solid var(--green); }
.flash--error { background: #fdecec; border-color: var(--red); }

/* auth */
.auth { max-width: 440px; margin: 6vh auto 0; background: #fff; border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--red); padding: 32px 26px; border-radius: 6px; }
.auth--inline { margin-top: 20px; }
.auth__logo { width: 120px; margin: 0 auto 18px; }
.auth h1 { font-size: 1.9rem; text-align: center; }
.auth > .muted { text-align: center; margin-bottom: 22px; }
.auth .small { text-align: center; margin-top: 18px; }
.wave { display: inline-block; animation: wave 2s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 20%, 60% { transform: rotate(14deg); } 40%, 80% { transform: rotate(-8deg); } }

/* fields */
.stack { display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span:first-child { font-weight: 700; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid #cfc7b9; border-radius: 10px; padding: 12px 14px; min-height: 50px;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,87,166,.15); }
.prefix { position: relative; display: block; }
.prefix i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 700; color: var(--muted); }
.prefix input { padding-left: 32px; }
.err { color: var(--red); font-weight: 500; font-size: .9rem; }
.choice { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.choice legend { font-weight: 700; font-size: .92rem; margin-bottom: 8px; padding: 0; }
.choice label, .check { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border: 2px solid #cfc7b9; border-radius: 10px; cursor: pointer; font-weight: 500; }
.choice label:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.choice input, .check input { width: 20px; height: 20px; accent-color: var(--red); }

/* dashboard */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.tabs { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--ink); font-weight: 500; font-size: .95rem; background: #fff; }
.tabs a.is-active { background: var(--ink); color: var(--canvas); }
.empty { text-align: center; padding: 50px 0; font-size: 1.15rem; color: var(--muted); }
.back { text-decoration: none; font-weight: 500; color: var(--muted); }

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.item { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; scroll-margin-top: 90px; transition: box-shadow .2s; }
.item:target { box-shadow: 0 0 0 4px var(--sun); }
.item__img { position: relative; display: block; aspect-ratio: 4/3; background: var(--paper); }
.item__img img { width: 100%; height: 100%; object-fit: cover; }
.stamp { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); font: 900 1.9rem/1 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--red); border: 4px solid var(--red); border-radius: 6px; padding: 6px 14px; background: rgba(255,255,255,.85); }
.star { position: absolute; top: 10px; left: 10px; background: #fff; border-radius: 999px; padding: 4px 8px; font-size: .9rem; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.item__body { padding: 14px 16px 6px; }
.price { font-weight: 700; margin: 6px 0 0; }
.item__actions { padding: 10px 16px 16px; display: grid; gap: 8px; margin-top: auto; }
.item__small { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.item__small form { display: flex; gap: 6px; }

/* editor */
.editor { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; margin-top: 18px; }
.editor__photo { position: sticky; top: 80px; }
.drop { display: grid; place-items: center; min-height: 300px; background: #fff; border: 3px dashed #cfc7b9; border-radius: 14px; cursor: pointer; overflow: hidden; position: relative; text-align: center; transition: border-color .2s; }
.drop:hover { border-color: var(--ink); }
.drop.has-err { border-color: var(--red); }
.drop img { width: 100%; height: auto; }
.drop__hint { font-size: 2.4rem; line-height: 1.3; padding: 30px; }
.drop__hint b { font-size: 1.05rem; } .drop__hint small { font-size: .85rem; color: var(--muted); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* messages */
.msgs { display: grid; gap: 16px; }
.msg { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 20px; }
.msg.is-new { border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--sun); }
.msg__head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.msg__head h2 { margin-top: 8px; }
.msg__art { display: flex; align-items: center; gap: 10px; background: var(--paper); padding: 8px 12px 8px 8px; border-radius: 10px; align-self: flex-start; }
.msg__art img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; }
.msg__body { margin: 14px 0; white-space: normal; }
.msg__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--paper); }
.tag--buy-a-piece { background: #fde3e4; color: var(--red); }
.tag--commission { background: #e2eaf7; color: var(--blue); }

@media (max-width: 760px) {
  .editor { grid-template-columns: 1fr; }
  .editor__photo { position: static; }
  .row { grid-template-columns: 1fr; }
  .top__nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .head .btn { width: 100%; }
  .list { grid-template-columns: 1fr; }
}
