/* ==========================================================================
   Admin editor + login — layered on top of viewer.css
   ========================================================================== */

/* ---------- dirty badge ---------- */

.dirty {
  margin-left: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #b4531a;
  background: #fdf0e3;
  border: 1px solid #f6d5b3;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.dirty[hidden] {
  display: none;
}

/* ---------- editable text ---------- */

body.admin [data-t] {
  outline: 1px dashed rgba(28, 111, 216, 0.42);
  outline-offset: 2px;
  border-radius: 3px;
  transition: outline-color 0.15s, background 0.15s;
  cursor: text;
  min-width: 8px;
  display: inline-block;
}
body.admin [data-t]:hover {
  outline-color: #1c6fd8;
  background: rgba(28, 111, 216, 0.06);
}
body.admin [data-t]:focus {
  outline: 2px solid #1c6fd8;
  outline-offset: 2px;
  background: rgba(28, 111, 216, 0.07);
  box-shadow: 0 0 0 4px rgba(28, 111, 216, 0.12);
}
body.admin .contact [data-t],
body.admin .fee.best [data-t],
body.admin .tt .c.d [data-t],
body.admin .tt .c.e [data-t] {
  outline-color: rgba(255, 255, 255, 0.5);
}
body.admin .contact [data-t]:hover,
body.admin .fee.best [data-t]:hover {
  outline-color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
body.admin .contact [data-t]:focus,
body.admin .fee.best [data-t]:focus {
  outline-color: #fff;
  background: rgba(255, 255, 255, 0.18);
}
body.admin .cover h1 [data-t],
body.admin h1.t [data-t] {
  display: inline;
}

/* ---------- photo slots ---------- */

body.admin .is[data-img] {
  cursor: pointer;
  position: relative;
}
body.admin .is[data-img]::after {
  content: '사진 편집';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 45, 85, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 7px 14px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 3;
  white-space: nowrap;
}
body.admin .is[data-img]:hover::after {
  opacity: 1;
}
body.admin .is[data-img]:hover {
  outline: 2px solid #1c6fd8;
  outline-offset: -2px;
}

/* ---------- list controls ---------- */

body.admin .lst-ctl {
  position: absolute;
  z-index: 20;
  display: none;
  gap: 4px;
  background: #0f2d55;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 6px 18px rgba(15, 45, 85, 0.3);
}
body.admin .lst-ctl.on {
  display: flex;
}
body.admin .lst-ctl button {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
body.admin .lst-ctl button:hover {
  background: #1c6fd8;
}
body.admin .lst-ctl button[disabled] {
  opacity: 0.3;
  cursor: default;
}
body.admin .lst-ctl button[disabled]:hover {
  background: rgba(255, 255, 255, 0.12);
}
body.admin .lst-ctl .add {
  background: #1c6fd8;
}
body.admin .lst-ctl .del:hover {
  background: #d94b3d;
}

/* outline the item being managed */
body.admin [data-item] {
  position: relative;
}
body.admin [data-item].hov {
  outline: 1.5px solid rgba(28, 111, 216, 0.7);
  outline-offset: 2px;
  border-radius: 6px;
}

/* belt swatch recolour swatches */
body.admin .swatch[data-belt] {
  cursor: pointer;
  position: relative;
}
body.admin .swatch[data-belt]:hover {
  outline: 2px solid #1c6fd8;
  outline-offset: 2px;
}

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 26, 45, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.on {
  display: flex;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 26px;
  width: min(660px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  box-shadow: 0 30px 80px rgba(12, 26, 45, 0.35);
}
.modal-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: #0f2d55;
  letter-spacing: -0.03em;
}
.modal-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: #5b6676;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}
.modal-actions .spacer {
  flex: 1;
}

/* ---------- crop ---------- */

.crop-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f6fb;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  padding: 16px;
}
.crop-frame {
  position: relative;
  overflow: hidden;
  background: #eef3f9;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(15, 45, 85, 0.12);
  cursor: grab;
  touch-action: none;
}
.crop-frame.dragging {
  cursor: grabbing;
}
.crop-frame img {
  position: absolute;
  top: 0;
  left: 0;
  user-select: none;
  pointer-events: none;
  max-width: none;
}
.crop-tools {
  margin-top: 14px;
}
.rng {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f2d55;
}
.rng input[type='range'] {
  flex: 1;
  accent-color: #1c6fd8;
}
.crop-tip {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: #8fa3bb;
}

/* ---------- history ---------- */

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #f5f9fe;
  border: 1px solid #e2ecf7;
  border-radius: 10px;
  font-size: 13.5px;
}
.history-list .v {
  font-weight: 800;
  color: #1c6fd8;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.history-list .t {
  color: #1d2633;
  font-weight: 600;
}
.history-list .w {
  color: #8fa3bb;
  font-size: 12.5px;
  margin-left: auto;
  white-space: nowrap;
}
.history-empty {
  padding: 18px;
  text-align: center;
  color: #8fa3bb;
  font-size: 13.5px;
  background: #f5f9fe;
  border-radius: 10px;
}

/* ---------- help ---------- */

.help-body h3 {
  margin: 16px 0 6px;
  font-size: 14.5px;
  font-weight: 800;
  color: #0f2d55;
}
.help-body h3:first-child {
  margin-top: 0;
}
.help-body p,
.help-body ul {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: #5b6676;
}
.help-body ul {
  padding-left: 18px;
}
.help-body code {
  background: #eaf4fd;
  color: #1c6fd8;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12.5px;
}

/* ---------- colour picker popover ---------- */

.palette {
  position: fixed;
  z-index: 110;
  background: #fff;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 18px 44px rgba(12, 26, 45, 0.28);
  display: none;
  width: 210px;
}
.palette.on {
  display: block;
}
.palette b {
  display: block;
  font-size: 12.5px;
  color: #0f2d55;
  margin-bottom: 8px;
}
.palette .sw {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}
.palette .sw button {
  appearance: none;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
  border: 1px solid rgba(15, 45, 85, 0.16);
  cursor: pointer;
  padding: 0;
}
.palette .sw button:hover {
  transform: scale(1.08);
}
.palette label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #5b6676;
}
.palette input[type='color'] {
  width: 36px;
  height: 26px;
  border: 1px solid #d9e3ef;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
  cursor: pointer;
}

/* ==========================================================================
   Login / setup page
   ========================================================================== */

body.auth {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #eaf4fd 0%, #dfe9f4 55%, #d4e4f5 100%);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  color: #1d2633;
  letter-spacing: -0.02em;
}
.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 32px 30px 26px;
  box-shadow: 0 24px 60px rgba(15, 45, 85, 0.16);
}
.auth-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1c6fd8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  flex: 0 0 auto;
}
.auth-head b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #0f2d55;
}
.auth-head span {
  font-size: 12.5px;
  color: #5b6676;
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  color: #0f2d55;
  letter-spacing: -0.035em;
  line-height: 1.35;
}
.auth-lead {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #5b6676;
}
.auth-error {
  margin: 0 0 16px;
  padding: 11px 14px;
  background: #fdeceb;
  border: 1px solid #f7cfcb;
  color: #b2352a;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.fld {
  display: block;
  margin-bottom: 14px;
}
.fld span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f2d55;
  margin-bottom: 6px;
}
.fld input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1.5px solid #d9e3ef;
  border-radius: 10px;
  background: #fafcfe;
  color: #1d2633;
  letter-spacing: 0.06em;
  transition: border-color 0.15s, background 0.15s;
}
.fld input:focus {
  outline: none;
  border-color: #1c6fd8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(28, 111, 216, 0.12);
}
.btn-primary {
  width: 100%;
  appearance: none;
  border: 0;
  background: #1c6fd8;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 4px;
  letter-spacing: -0.01em;
  transition: background 0.15s;
}
.btn-primary:hover {
  background: #1a63c2;
}
.auth-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
}
.auth-foot a {
  color: #5b6676;
  text-decoration: none;
}
.auth-foot a:hover {
  color: #1c6fd8;
}

/* admin-only toolbar note */
body.admin .hint b {
  color: #1c6fd8;
}
