* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  background: #f4f4f5;
  color: #18181b;
}
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
}
.top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 24px;
}
.label {
  display: inline-block;
  background: #fff;
  color: #71717a;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  margin-bottom: 10px;
}
h1 { margin: 0; font-size: 36px; letter-spacing: -0.04em; }
p { color: #71717a; margin: 8px 0 0; line-height: 1.6; }
.tabs {
  display: flex;
  background: #fff;
  padding: 4px;
  border-radius: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.tabs a {
  border: 0;
  background: transparent;
  padding: 11px 18px;
  border-radius: 14px;
  font-weight: 700;
  color: #71717a;
  cursor: pointer;
  text-decoration: none;
}
.tabs a.active {
  background: #18181b;
  color: #fff;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.top-actions .tabs {
  flex-shrink: 0;
}
.top-actions .tabs a {
  white-space: nowrap;
}
.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #18181b;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  white-space: nowrap;
}
.logout-link:hover {
  background: #fafafa;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
}
.card {
  background: #fff;
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.card h2, .card h3 { margin: 0 0 6px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.form-grid.one {
  grid-template-columns: 1fr;
}
label span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
input[type="text"], input[type="number"], input[type="search"] {
  width: 100%;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  padding: 14px 15px;
  font-size: 15px;
  outline: none;
}
input:focus { border-color: #18181b; }
.drop {
  margin-top: 16px;
  display: block;
  text-align: center;
  background: #fafafa;
  border: 1px dashed #d4d4d8;
  border-radius: 24px;
  padding: 28px;
  cursor: pointer;
}
.drop strong { display: block; margin-bottom: 6px; }
.drop small { color: #71717a; }
.drop input { display: none; }
.btn {
  border: 0;
  background: #18181b;
  color: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.btn.full { width: 100%; margin-top: 18px; }
.btn.sub {
  background: #fff;
  color: #18181b;
  border: 1px solid #e4e4e7;
}
.preview-box {
  overflow: hidden;
  border: 1px solid #e4e4e7;
  border-radius: 24px;
  margin-top: 18px;
}
.preview-img {
  height: 300px;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a1a1aa;
}
.preview-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-info { padding: 20px; }
.preview-info .name { font-size: 22px; font-weight: 900; }
.preview-info .sheet { color: #71717a; font-size: 14px; margin-top: 4px; }
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.mini-stats div {
  background: #f4f4f5;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}
.mini-stats b { display: block; font-size: 20px; margin-top: 3px; }
.mini-stats em { display: block; margin-top: 3px; font-size: 11px; font-style: normal; color: #71717a; }
.mini-stats .total em { color: #d4d4d8; }
.mini-stats small { color: #71717a; }
.mini-stats .total { background: #18181b; color: #fff; }
.mini-stats .total small { color: #d4d4d8; }
.master-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.master-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
}
th {
  background: #fafafa;
  color: #71717a;
  font-size: 12px;
  text-align: left;
  padding: 12px;
}
td {
  border-top: 1px solid #e4e4e7;
  padding: 12px;
  vertical-align: middle;
}
td.num, th.num { text-align: right; }
.thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a1a1aa;
  font-size: 12px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank { font-weight: 900; }
.delete {
  border: 0;
  background: #fff1f2;
  color: #be123c;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}
.empty {
  border: 1px dashed #d4d4d8;
  border-radius: 24px;
  padding: 60px 20px;
  text-align: center;
  color: #71717a;
  background: #fafafa;
}
@media (max-width: 980px) {
  .top, .master-head { flex-direction: column; align-items: stretch; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .wrap { padding: 20px; }
  h1 { font-size: 28px; }
  table { min-width: 860px; }
  .table-scroll { overflow-x: auto; }
}


.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0,0,0,.72);
}
.image-modal.open {
  display: flex;
}
.image-modal-inner {
  position: relative;
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.image-modal img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 84px);
  object-fit: contain;
  border-radius: 16px;
  background: #f4f4f5;
}
.image-modal-title {
  padding: 2px 48px 12px 4px;
  font-weight: 900;
}
.image-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #18181b;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.thumb.clickable {
  cursor: zoom-in;
}
.thumb.clickable:hover {
  outline: 2px solid #18181b;
  outline-offset: 2px;
}

@media (max-width: 980px) {

  .top-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .top-actions .tabs a {
    padding: 10px 14px;
  }
  .logout-link {
    height: 42px;
    padding: 0 14px;
  }

}


.guide-box {
  margin-top: 18px;
  border: 1px solid #e4e4e7;
  border-radius: 24px;
  background: #fafafa;
  padding: 16px;
}
.guide-title {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 900;
  color: #18181b;
}
.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.guide-grid figure {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e4e4e7;
}
.guide-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.guide-grid figcaption {
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #52525b;
}
.preview-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f4f4f5;
  padding: 8px;
}
.preview-img.small {
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  background: #ececef;
}
.thumb {
  border: 0;
}


.editor-wrap {
  margin-top: 18px;
  border: 1px solid #e4e4e7;
  border-radius: 24px;
  background: #fff;
  padding: 16px;
}
.editor-title {
  font-size: 15px;
  font-weight: 900;
  color: #18181b;
}
.editor-help {
  margin-top: 6px;
  font-size: 13px;
  color: #71717a;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.editor-panel {
  position: relative;
  border: 1px solid #e4e4e7;
  border-radius: 18px;
  background: #fafafa;
  padding: 12px;
  min-height: 220px;
}
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.editor-head strong {
  font-size: 13px;
}
.btn.mini {
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}
.editor-panel canvas {
  display: none;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  cursor: crosshair;
  background: #e4e4e7;
}
.editor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border: 1px dashed #d4d4d8;
  border-radius: 14px;
  color: #a1a1aa;
  font-size: 13px;
  text-align: center;
  padding: 16px;
}
