/* ===== Sale page, register/manage form, misc pages ===== */
a.back { display: inline-block; margin: 18px 0 14px; font-weight: 700; text-decoration: none; color: var(--ink-2); }
a.back:hover { color: var(--ink); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.banner { background: var(--yellow-l); border: 1.5px solid #f1d77a; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.banner.dark { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- sale page ---- */
.sale-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.gallery { position: sticky; top: 84px; }
.g-main { display: block; width: 100%; padding: 0; border: 0; background: var(--paper-2); border-radius: 18px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.g-main img { width: 100%; height: 100%; object-fit: cover; }
.g-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.g-thumbs button { flex: none; width: 76px; height: 76px; padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--paper-2); }
.g-thumbs button.on { border-color: var(--red); }
.g-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info .tops { display: flex; gap: 6px; margin-bottom: 8px; }
.info h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.025em; }
.addr { font-size: 18px; color: var(--ink-2); margin: 0 0 18px; }
.addr b { color: var(--ink); }

/* the "When" box is drawn like a swing tag */
.tag-card { position: relative; background: var(--yellow); border-radius: 6px 16px 16px 6px; padding: 16px 20px 16px 46px; margin-bottom: 18px; box-shadow: 0 2px 0 #d9a91c; transform: rotate(-.6deg); }
.tag-hole { position: absolute; left: 16px; top: 24px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.tag-title { font: 700 26px/1 var(--hand); margin-bottom: 6px; }
.day { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1.5px dashed rgba(29, 35, 39, .2); font-size: 16px; flex-wrap: wrap; }
.day:first-of-type { border-top: 0; }
.day.next b::after { content: ' ← next'; font-weight: 600; font-size: 13px; color: var(--red-d); }
.day.past { opacity: .5; text-decoration: line-through; }
.act-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.facts { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; font-weight: 600; }
.facts li { display: flex; align-items: center; gap: 10px; }
.facts .ico { color: var(--muted); }
.book-link { display: inline-flex !important; align-items: center; gap: 8px; }
.cats { margin-bottom: 16px; }
.cats .chip { text-decoration: none; font-size: 13px; }
.desc { background: var(--card); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); font-size: 16px; margin-bottom: 18px; overflow-wrap: anywhere; }
.mini-map { height: 240px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.book-link { display: block; margin-top: 14px; font-weight: 700; }

.lightbox { position: fixed; inset: 0; background: rgba(15, 15, 15, .94); z-index: 3000; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 6px; }
.lb-close, .lb-nav { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 30px; line-height: 1; cursor: pointer; }
.lb-close { top: 14px; right: 14px; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-count { position: absolute; bottom: 18px; color: #ddd; font-weight: 700; }

@media (max-width: 860px) {
  .sale-grid { grid-template-columns: 1fr; gap: 18px; }
  .gallery { position: static; }
}

/* ---- register form ---- */
.reg-page { max-width: 820px; }
.reg-head { padding: 28px 0 10px; }
.reg-head h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -.03em; }
.reg-head .lead { font-size: 17px; color: var(--ink-2); margin: 0; }
.reg-form { display: grid; gap: 18px; margin-top: 18px; }
.hp { position: absolute; left: -9999px; }
.step { padding: 22px 22px 24px; }
.step-h { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-h h2 { font-size: 22px; margin: 2px 0 2px; }
.step-h p { margin: 0; }
.step-n { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font: 700 26px/1 var(--hand); transform: rotate(-6deg); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.span2 { grid-column: 1 / -1; }
.geo-results { display: grid; gap: 6px; margin: 10px 0 0; }
.geo-results button { text-align: left; border: 1.5px solid var(--line); background: #fff; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.geo-results button.on { border-color: var(--ink); background: var(--paper-2); }
.pin-map-wrap { margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--line); }
.pin-map { height: 320px; }
.pin-help { padding: 10px 14px; font-size: 14px; background: var(--paper-2); color: var(--ink-2); }
.pin-help.ok { background: var(--teal-l); color: var(--teal); font-weight: 600; }

.quick-days { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.quick-days .hint { margin-right: 4px; }
.dates { display: grid; gap: 10px; margin-bottom: 12px; }
.date-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 40px; gap: 10px; align-items: end; background: var(--paper); padding: 12px; border-radius: 12px; }
.date-row.past { opacity: .6; }
.date-row .f { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.date-row .rm { height: 46px; border: 0; background: transparent; font-size: 26px; color: var(--muted); cursor: pointer; border-radius: 10px; }
.date-row .rm:hover { background: var(--paper-2); color: var(--red); }
.count-row { text-align: right; margin: 4px 0 12px; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin-bottom: 8px; }
.add-photo, .ph-tile { aspect-ratio: 1; border-radius: 12px; position: relative; overflow: hidden; }
.add-photo { border: 2px dashed var(--kraft); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; background: var(--paper); padding: 8px; }
.add-photo:hover { background: var(--yellow-l); }
.add-photo span { font-size: 30px; line-height: 1; color: var(--red); }
.add-photo b { font-size: 14px; }
.add-photo small { font-size: 11px; color: var(--muted); }
.add-photo[hidden] { display: none; }
.ph-tile { background: var(--paper-2); cursor: grab; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; }
.ph-tile.dragging { opacity: .4; }
.ph-tile .x, .ph-tile .mv { position: absolute; top: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.ph-tile .x { right: 6px; }
.ph-tile .mv { left: 6px; }
.ph-tile .cover { position: absolute; left: 6px; bottom: 6px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 8px; }
.spin { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.checks { display: flex; flex-direction: column; justify-content: flex-end; }
.checks.row { flex-direction: row; flex-wrap: wrap; gap: 4px 24px; justify-content: flex-start; }
.errors { background: #fdeceb; border: 1.5px solid #f3b8b1; color: #8c2015; padding: 14px 18px; border-radius: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.submit-row { text-align: center; padding: 6px 0 20px; }
.submit-row .btn { min-width: 260px; }
.submit-row .hint { margin-top: 10px; }

.manage-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 12px 16px; margin-top: 16px; }
.mb-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.danger { color: var(--red-d) !important; }

.done { padding: 34px 28px; text-align: center; margin-top: 28px; }
.done-tag { display: inline-block; font: 700 30px/1 var(--hand); background: var(--yellow); padding: 8px 18px 6px; border-radius: 6px 14px 14px 6px; transform: rotate(-3deg); margin-bottom: 14px; }
.done h2 { font-size: 30px; }
.done > p { color: var(--ink-2); font-size: 17px; }
.manage-box { text-align: left; background: var(--paper); border-radius: 14px; padding: 16px; margin: 20px 0; }
.copy-row { display: flex; gap: 8px; margin: 8px 0 6px; }
.copy-row .in { font-size: 14px; }
.done-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

@media (max-width: 640px) {
  .step { padding: 18px 14px 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .date-row { grid-template-columns: 1fr 1fr 36px; }
  .date-row > div:first-child { grid-column: 1 / -1; }
  .pin-map { height: 260px; }
  .submit-row .btn { width: 100%; min-width: 0; }
}

/* ---- 404 ---- */
.nf { text-align: center; padding: 80px 0 40px; }
.nf h1 { font-size: 44px; }
