/* Admin page — builds on the site's own css/style.css */
.admin__main { max-width: 1100px; width: 100%; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 8rem; }
.admin__who { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .25rem 1rem; font-size: .9rem; color: var(--text-dim); }
.admin__who a { font: 400 1.2rem/1 var(--font-display); color: var(--text); }
.admin__status { text-align: center; font: 400 1.5rem/1.4 var(--font-display); padding: 3rem 1rem; white-space: pre-line; }
.admin h2 { font-size: 2rem; margin: 2rem 0 .25rem; }
.admin section > h2:first-child { margin-top: .5rem; }
.hint { color: var(--text-dim); font-size: .95rem; margin: .25rem 0 1.25rem; }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.tabs button {
  font: 400 1.4rem/1 var(--font-display); letter-spacing: .02em;
  color: var(--text); background: var(--plum);
  border: 0; border-radius: 999px; padding: .6rem 1.2rem; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--lavender); color: var(--ink); box-shadow: 0 4px 0 #8f7fa8; }

/* buttons */
.btn { border: 0; cursor: pointer; }
.btn--small { font-size: 1.15rem; padding: .5rem 1rem; box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, var(--ink)); }
.btn--go { --accent: #b7cdb4; }
.btn--danger { --accent: var(--rose); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: .75rem; }

/* form fields */
.form { display: grid; gap: 1rem; max-width: 640px; }
.field { display: grid; gap: .3rem; font-weight: 800; font-size: .95rem; }
.field small { font-weight: 400; color: var(--text-dim); }
.field--inline { display: flex; align-items: center; gap: .6rem; }
.admin input[type="text"], .admin input[type="email"], .admin input[type="url"], .admin textarea, .admin select {
  font: 400 1rem/1.4 var(--font-body); color: var(--ink);
  background: var(--paper); border: 2px solid transparent; border-radius: 12px;
  padding: .6rem .8rem; width: 100%; min-width: 0;
}
.admin select { width: auto; }
.admin input:focus, .admin textarea:focus, .admin select:focus { outline: none; border-color: var(--lavender); box-shadow: 0 0 0 3px rgba(205, 191, 230, .5); }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: .95rem; cursor: pointer; }
.check input { width: 1.3rem; height: 1.3rem; accent-color: var(--plum); }

/* artwork grid */
.pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.pieces--small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 55vh; overflow: auto; padding: .25rem; }
.piece {
  position: relative; padding: 0; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--paper); border: 5px solid var(--paper); border-radius: 16px;
  box-shadow: 0 5px 0 rgba(43, 34, 47, .28); overflow: hidden;
}
.piece:hover { transform: translateY(-2px); }
.piece img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 25%; border-radius: 10px; background: var(--lilac); }
.piece__title { display: block; font: 400 1.15rem/1.1 var(--font-display); padding: .4rem .3rem .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece__type { display: inline-block; font-size: .7rem; font-weight: 800; padding: .1rem .5rem; margin: .1rem .3rem .3rem; border-radius: 999px; background: var(--c, var(--lilac)); }
.piece__star { position: absolute; top: 6px; right: 6px; background: var(--paper); border-radius: 999px; padding: .1rem .45rem; font-size: .8rem; font-weight: 800; }
.piece--busy { opacity: .6; pointer-events: none; }
.empty-note { color: var(--text-dim); font-style: italic; }

/* homepage tab */
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; max-width: 720px; }
.slot {
  position: relative; aspect-ratio: 4 / 5; border-radius: 16px; overflow: hidden;
  background: var(--layer-1); border: 3px dashed var(--layer-2);
  display: grid; place-items: center;
}
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; }
.slot--filled { border: 5px solid var(--paper); }
.slot button.slot__add { all: unset; cursor: pointer; position: absolute; inset: 0; display: grid; place-items: center; font: 400 1.3rem/1 var(--font-display); text-align: center; }
.slot__remove { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: var(--paper); color: var(--ink); font-weight: 800; box-shadow: 0 3px 0 rgba(43, 34, 47, .3); }
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.25rem; }
.cover { display: grid; gap: .6rem; justify-items: start; }
.cover__img { width: 100%; aspect-ratio: 1; border-radius: 20px; border: 6px solid var(--c); background: color-mix(in srgb, var(--c) 45%, var(--paper)); object-fit: cover; object-position: 50% 22%; display: block; }
.cover__name { font: 400 1.5rem/1 var(--font-display); }
.cover__name small { font: 600 .75rem/1 var(--font-body); color: var(--text-dim); margin-left: .4rem; }
@media (max-width: 520px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* art types tab */
.types { display: grid; gap: .75rem; margin-bottom: 1.5rem; max-width: 720px; }
.type { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; background: var(--plum); border-radius: 16px; padding: .7rem .8rem; }
.type input[type="color"] { width: 44px; height: 44px; padding: 0; border: 3px solid var(--paper); border-radius: 12px; background: none; cursor: pointer; flex: none; }
.type input[type="text"] { flex: 1 1 160px; font: 400 1.4rem/1.2 var(--font-display); }
.type__count { font-size: .8rem; color: var(--text-dim); white-space: nowrap; }
.type .btn--small { padding: .45rem .8rem; }

/* dialogs */
.sheet { border: 0; padding: 0; border-radius: 22px; background: var(--bg); color: var(--text); width: min(880px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); box-shadow: 0 10px 0 rgba(43, 34, 47, .4); }
.sheet::backdrop { background: rgba(58, 46, 64, .85); }
.sheet__body { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 1.5rem; padding: 1.5rem; }
.sheet__body--stack { grid-template-columns: 1fr; gap: 1rem; }
.sheet h2 { margin: 0; }
.edit__photo { display: grid; gap: .8rem; align-content: start; justify-items: start; }
.edit__photo img { width: 100%; border-radius: 14px; border: 5px solid var(--paper); background: var(--paper); }
.edit__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.picker__extra { display: flex; flex-wrap: wrap; gap: .6rem; }
.picker__extra:empty { display: none; }
@media (max-width: 680px) {
  .sheet__body { grid-template-columns: 1fr; padding: 1rem; }
  .edit__photo img { max-height: 32vh; width: auto; }
}

/* publish bar + toast */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1rem;
  padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
  background: var(--plum); box-shadow: 0 -5px 0 rgba(43, 34, 47, .2);
  font: 400 1.3rem/1.2 var(--font-display);
}
.toast {
  position: fixed; left: 50%; bottom: 6.5rem; transform: translateX(-50%); z-index: 40;
  background: var(--paper); color: var(--ink); padding: .7rem 1.3rem; border-radius: 999px;
  font-weight: 800; box-shadow: 0 5px 0 rgba(43, 34, 47, .35); max-width: calc(100vw - 2rem); text-align: center;
}
.toast--bad { background: var(--rose); }
