/* 사이트 관리 — mobile first */
.site-admin{
  --pad: 14px;
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: calc(60px + 16px) var(--pad) 96px;
  color: #111827;
  -webkit-tap-highlight-color: transparent;
}
.site-admin *,.site-admin *::before,.site-admin *::after{box-sizing:border-box}
.site-admin h2{margin:0 0 6px;font-size:24px;font-weight:800;line-height:1.25}
.site-admin .sub{color:#6b7280;font-size:14px;line-height:1.45;margin:0 0 16px}

.site-tabs{
  position: sticky;
  top: 60px;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  margin: 0 calc(var(--pad) * -1) 16px;
  padding: 10px var(--pad) 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}
.site-tabs::-webkit-scrollbar{
  height: 6px;
  display: block;
}
.site-tabs::-webkit-scrollbar-track{
  background: #f1f5f9;
  border-radius: 9999px;
}
.site-tabs::-webkit-scrollbar-thumb{
  background: #cbd5e1;
  border-radius: 9999px;
}
.site-tabs::-webkit-scrollbar-thumb:hover{
  background: #94a3b8;
}
.site-tabs button{
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 9999px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  min-height: 38px;
  color: #4b5563;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.site-tabs button:hover{
  background: #f3f4f6;
  color: #111827;
}
.site-tabs button.active{
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.15);
}

.site-panel{display:none}
.site-panel.active{display:block}

.card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:14px;
  margin-bottom:12px;
  box-shadow:0 4px 14px rgba(16,24,40,.04);
}
.card h3{margin:0 0 10px;font-size:15px}
.card .hint{margin:0 0 12px;font-size:12px;color:#6b7280;line-height:1.45}

.toolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:stretch;
  margin-bottom:10px;
}
.btn{
  border:0;
  background:#111;
  color:#fff;
  border-radius:12px;
  padding:12px 14px;
  font-weight:800;
  cursor:pointer;
  font-size:14px;
  min-height:44px;
  flex:1 1 auto;
}
.btn.secondary{background:#f3f4f6;color:#111}
.btn.small{padding:8px 10px;font-size:13px;min-height:36px;flex:0 0 auto}
.btn:disabled{opacity:.45;cursor:not-allowed}

.brand-list{display:flex;flex-direction:column;gap:8px}
.brand-row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
  align-items:center;
  border:1px solid #eef2f7;
  background:#fafbfc;
  border-radius:14px;
  padding:12px;
}
.brand-row.disabled{opacity:.55}
.brand-main{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.brand-main label{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  font-size:15px;
  cursor:pointer;
  min-width:0;
}
.brand-main input[type="checkbox"]{
  width:20px;
  height:20px;
  flex:0 0 auto;
}
.brand-meta{font-size:11px;color:#9ca3af;font-weight:700}
.brand-actions{display:flex;gap:6px}
.brand-actions .btn{min-width:40px}

.empty{color:#9ca3af;padding:20px 12px;text-align:center;font-size:13px}

#snackbar.site-toast{
  visibility:hidden;
  left:50%;
  bottom:24px;
  transform:translateX(-50%);
  width:calc(100% - 32px);
  max-width:420px;
  margin:0;
  background:rgba(17,17,17,.94);
  color:#fff;
  text-align:center;
  border-radius:14px;
  padding:14px 16px;
  position:fixed;
  z-index:9999;
  font-weight:800;
  font-size:13px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
#snackbar.site-toast.show{visibility:visible}

@media (max-width: 640px) {
  .site-admin {
    padding: calc(60px + env(safe-area-inset-top, 0px) + 12px) 12px calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .card {
    padding: 16px 14px;
    border-radius: 14px;
  }
  .toolbar {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .toolbar .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 14px;
  }
  .brand-row {
    padding: 12px;
  }
  .brand-actions .btn {
    padding: 8px 12px;
    min-height: 38px;
  }
  .site-tabs {
    top: calc(60px + env(safe-area-inset-top, 0px));
    padding: 8px var(--pad) 10px;
    margin-bottom: 12px;
  }
  .site-tabs button {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
  }
  #scheduleEditorModal > div {
    width: 95% !important;
    max-height: 90vh !important;
    padding: 20px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width:640px){
  .toolbar .btn{flex:0 0 auto}
}

.preset-btn.active{
  background:#0f172a !important;
  color:#fff !important;
  border-color:#0f172a !important;
}
